//\u6b64\u5355\u5143\u662f\u7535\u8def\u8c03\u5ea6\u529f\u80fd\u76f8\u5173\u7684\u548c\u7535\u8def\u8c03\u5ea6\u516c\u7528\u65b9\u6cd5

/*------------------------------------------------------------------------------
\u4e0b\u8fb9\u662f\u7535\u8def\u8c03\u5ea6\u529f\u80fd\u76f8\u5173\u65b9\u6cd5\u548c\u5c5e\u6027 wangyisong 061109
------------------------------------------------------------------------------*/
//\u521d\u59cb\u5316\u8def\u7531\u6bb5\u5217\u8868\u5e76\u4e14\u5237\u65b0\u7ed3\u6784\u5316\u8def\u7531 \u8c03\u5ea6\u548c\u7535\u8def\u7f16\u8f91\u516c\u7528 liuyingnan 20061116
    function setRouteSegAndPathInfo(basicPage,routePage){
          var basicPageForm = basicPage.document.pBasicForm;
          var routePageForm = routePage.document.pRouteForm;
          //\u7ec8\u7aef\u7ad9\u70b9A
          var aName=basicPageForm.edit_a_zdsite_name.value;
          var aCuid=basicPageForm.edit_a_zdsite_cuid.value;
          //\u7ec8\u7aef\u7ad9\u70b9Z
          var zName=basicPageForm.edit_z_zdsite_name.value;
          var zCuid=basicPageForm.edit_z_zdsite_cuid.value;
          //\u8f6c\u63a5\u7ad9
          var cName = basicPageForm.edit_zjsites_name.value;
          var cCuid = basicPageForm.edit_zjsites_cuid.value;
          if(cCuid.length>0){
            aCuid+=','+cCuid;
            aName+=','+cName;
          }
          aCuid+=','+zCuid;
          aName+=','+zName;
          var cuids = aCuid.split(',');
          var names = aName.split(',');
          var list =routePageForm.routeSegs;
          list.options.length = 0;
          for(i=0;i<names.length-1;i++){
            var text = names[i] + '->' +names[i+1];
            var value = cuids[i] + '@' + cuids[i+1];
            addOptionToList(list,text,value);
          }
          //\u5237\u65b0\u7ed3\u6784\u5316\u8def\u7531
          var traphEditForm = new Object;
          var selPathGrid = routePage.selectedPathGrid;
          selPathGrid.clearAll();
          traphEditForm.routePoints = aCuid;//\u8bbe\u7f6e\u8def\u7531\u8282\u70b9\u7ed3\u6784
          traphEditForm.relatedAEndSwitchdevCuid = basicPageForm.edit_endSwitchDevA_cuid.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
          traphEditForm.relatedZEndSwitchdevCuid = basicPageForm.edit_endSwitchDevZ_cuid.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
          traphEditForm.endSwitchDevA = basicPageForm.edit_endSwitchDevA.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
          traphEditForm.endSwitchDevZ = basicPageForm.edit_endSwitchDevZ.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
          traphEditForm.relatedAEndSwitchPortCuid = basicPageForm.edit_endSwitchdevPortACuid.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
          traphEditForm.relatedZEndSwitchPortCuid = basicPageForm.edit_endSwitchdevPortZCuid.value;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
          traphEditForm.endSwitchdevPortA = basicPageForm.edit_endSwitchdevPortA.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
          traphEditForm.endSwitchdevPortZ = basicPageForm.edit_endSwitchdevPortZ.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
          traphEditForm.jhroomA = basicPageForm.edit_jhroomA.value; //A\u7aef\u4e1a\u52a1\u673a\u623f
          traphEditForm.jhroomZ = basicPageForm.edit_jhroomZ.value; //Z\u7aef\u4e1a\u52a1\u673a\u623f
          TraphAjaxActionNew.getArrTraphRouteDesc(traphEditForm,function(data){//\u83b7\u5f97\u7ed3\u6784\u5316\u8def\u7531
            if (data != null){
              for(i=0;i<data.length;i++ ){
                selPathGrid.addRow(i,data[i][1]+","+data[i][2]+","+data[i][3],i);
                selPathGrid.setUserData(i,'pathType',data[i][0]);//\u8bbe\u7f6e\u8def\u7531\u7c7b\u578b
                selPathGrid.setUserData(i,'channeldistrict',data[i][4]);//\u8bbe\u7f6e\u8def\u7531\u6bb5\u533a\u57df
                selPathGrid.setUserData(i,'channellevel',data[i][5]);//\u8bbe\u7f6e\u901a\u9053\u7ea7\u522b
                selPathGrid.setUserData(i,'isPro',data[i][6]);//\u8bbe\u7f6e\u7701\u90e8\u6587\u672c\u6bb5\u6807\u793a
                selPathGrid.setUserData(i,'isOut',data[i][7]);
              }
            }
            list.options.selectedIndex = 0;//\u8bbe\u7f6e\u9ed8\u8ba4\u9009\u4e2d
            list.fireEvent("onclick");

          var jumpPairGrid = routePage.jumpPairGrid;
          jumpPairGrid.clearAll();
          TraphAjaxActionNew.getDDFInfosList(function(rtn){
              if(rtn!=null){
                for(i=0;i<rtn.length;i++){
                    jumpPairGrid.addRow(rtn[i][0],rtn[i][1],i);
                }
              }
            });
          });

        //\u8bbe\u7f6e\u7535\u8def\u901f\u7387\u9690\u85cf\u503c added by liuyingnan stamp \u7aef\u53e3\u8c03\u5ea6
        routePageForm.cmbChannelRate.value = basicPageForm.cmb_basic_traph_speed.value;//\u901f\u7387
        //\u8bbe\u7f6e\u8def\u7531\u5f97\u8d77\u6b62\u7ec8\u7aef\u8d77\u6b62\u4e1a\u52a1\u8bbe\u5907\u4e1a\u52a1\u7c7b\u578b add by jej on 20070622
        routePageForm.staACuid.value=basicPageForm.edit_a_zdsite_cuid.value;//A\u7aef\u7ec8\u7aef
        routePageForm.devACuid.value=basicPageForm.edit_endSwitchDevA_cuid.value;//A\u7aef\u4e1a\u52a1\u8bbe\u5907
        routePageForm.staZCuid.value=basicPageForm.edit_z_zdsite_cuid.value;//Z\u7aef\u7ec8\u7aef
        routePageForm.devZCuid.value=basicPageForm.edit_endSwitchDevZ_cuid.value;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907
        routePageForm.traphExt.value=basicPageForm.edit_basic_traph_ext_id.value;//\u4e1a\u52a1\u7c7b\u578b
    }

    //\u8bbe\u7f6eMSTP\u7684\u8def\u7531\u9875\u4fe1\u606f
    function setMstpRouteSegAndPathInfo(basicPage,routePage){
      var basicPageForm = basicPage.document.pBasicForm;
      var routePageForm = routePage.document.pRouteForm;
      //\u7ec8\u7aef\u7ad9\u70b9A
      var aName=basicPageForm.edit_a_zdsite_name.value;
      var aCuid=basicPageForm.edit_a_zdsite_cuid.value;
      //\u7ec8\u7aef\u7ad9\u70b9Z
      var zName=basicPageForm.edit_z_zdsite_name.value;
      var zCuid=basicPageForm.edit_z_zdsite_cuid.value;
      //\u8f6c\u63a5\u7ad9
      var cName = basicPageForm.edit_zjsites_name.value;
      var cCuid = basicPageForm.edit_zjsites_cuid.value;
      if(cCuid.length>0){
        aCuid+=','+cCuid;
        aName+=','+cName;
      }
      aCuid+=','+zCuid;
      aName+=','+zName;
      var list =routePage.routeSegsTable;
      //\u83b7\u5f97\u9ed8\u8ba4\u9009\u4e2d\u884c
      var macIndex = list.getSelectedId();
      var ind = list.getRowIndex(macIndex);
      if(ind == -1){
        ind = 0;
      }
      list.clearAll();
      TraphAjaxActionNew.getMacRouteSegs(aCuid,aName,function(data){//\u5237\u65b0MAC\u8def\u7531\u6bb5
        if (data != null){
          //\u5e8f\u53f7\uff0c\u8d77\u6b62\u7ad9\u70b9CUID\uff0c\u8d77\u6b62\u7ad9\u70b9\u540d\u79f0\uff0c\u8def\u7531\u6bb5\u5217\u8868,A\u7aefMAC\u53e3,A\u7aefMP,A\u7aefVLANID,Z\u7aefMAC\u53e3,Z\u7aefMP,Z\u7aefVLANID,\u5de5\u4f5c\u6a21\u5f0f,MSTP\u4e1a\u52a1\u7c7b\u578b
          for(i=0;i<data.length;i++ ){
            var aMac="",aMacCuid="",aMp="",aMpCuid= "",aVlanid="",zMac="",zMacCuid="",zMp="",zMpCuid="",zVlanid="",gzms="",gzmsValue="",ywlx="",ywlxValue="";
            if(data[i][3] != ""){
                aMac = data[i][3].split("@")[1];
                aMacCuid = data[i][3].split("@")[0];
            }
            if(data[i][4] != ""){
                aMp = data[i][4].split("@")[1];
                aMpCuid = data[i][4].split("@")[0];
            }
            aVlanid = data[i][5];
            if(data[i][6] != ""){
                zMac = data[i][6].split("@")[1];
                zMacCuid = data[i][6].split("@")[0];
            }
            if(data[i][7] != ""){
                zMp = data[i][7].split("@")[1];
                zMpCuid = data[i][7].split("@")[0];
            }
            zVlanid = data[i][8];
            if(data[i][9] != ""){
                gzms = data[i][9].split("@")[1];
                gzmsValue = data[i][9].split("@")[0];
            }
            if(data[i][10] != ""){
                ywlx = data[i][10].split("@")[1];
                ywlxValue = data[i][10].split("@")[0];
            }

            var sValue = data[i][2]+","+aMac+","+aMp+","+aVlanid+","+zMac+","+zMp+","+zVlanid+","+gzms+","+ywlx;

            list.addRow(data[i][0],sValue,i);
            list.setUserData(i,"azCuids",data[i][1]);
            list.setUserData(i,"azNames",data[i][2]);
            list.setUserData(i,"aMacCuid",aMacCuid);
            list.setUserData(i,"aMpCuid",aMpCuid);
            list.setUserData(i,"zMacCuid",zMacCuid);
            list.setUserData(i,"zMpCuid",zMpCuid);
            list.setUserData(i,"gzmsValue",gzmsValue);
            list.setUserData(i,"ywlxValue",ywlxValue);
            list.setUserData(i,"isMstp",data[i][11]);//\u662f\u5426\u662fMSTP\u901a\u9053
          }
          list.selectRow(ind);
          routePage.selectRouteSegsRow();

          TraphAjaxActionNew.getTraphInfo(function(data){
            if(data != null){
                basicPageForm.edit_macPortA.value = data.endPortA;
                basicPageForm.edit_macPortACuid.value = data.relatedAPortCuid;
                basicPageForm.edit_vctrunkPortA.value = data.endVctrunkA;
                basicPageForm.edit_vctrunkPortA_cuid.value = data.relatedAVctrunkCuid;

                basicPageForm.edit_macPortZ.value = data.endPortZ;
                basicPageForm.edit_macPortZCuid.value = data.relatedZPortCuid;
                basicPageForm.edit_vctrunkPortZ.value = data.endVctrunkZ;
                basicPageForm.edit_vctrunkPortZ_cuid.value = data.relatedZVctrunkCuid;
            }
          });
        }
      });

      //\u5237\u65b0\u8df3\u7ebf\u548c\u8def\u7531
      var jumpPairGrid = routePage.jumpPairGrid;
      jumpPairGrid.clearAll();
      TraphAjaxActionNew.getDDFInfoDetailForMacPageListView(function(rtn){
        if(rtn!=null){
          for(i=0;i<rtn.length;i++){
            jumpPairGrid.addRow(rtn[i][0],rtn[i][1],i);
          }
        }
      });

      //\u8bbe\u7f6e\u7535\u8def\u901f\u7387\u9690\u85cf\u503c
      routePageForm.cmbChannelRate.value = basicPageForm.cmb_basic_traph_speed.value;//\u901f\u7387
      //\u8d1f\u8377\u5206\u62c5\u7528
      routePageForm.staACuid.value=basicPageForm.edit_a_zdsite_cuid.value;//A\u7aef\u7ec8\u7aef
      routePageForm.devACuid.value=basicPageForm.edit_endSwitchDevA_cuid.value;//A\u7aef\u4e1a\u52a1\u8bbe\u5907
      routePageForm.devAName.value=basicPageForm.edit_endSwitchDevA.value;//A\u7aef\u4e1a\u52a1\u8bbe\u5907
      routePageForm.staZCuid.value=basicPageForm.edit_z_zdsite_cuid.value;//Z\u7aef\u7ec8\u7aef
      routePageForm.devZCuid.value=basicPageForm.edit_endSwitchDevZ_cuid.value;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907
      routePageForm.devZName.value=basicPageForm.edit_endSwitchDevZ.value;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907
      routePageForm.traphExt.value=basicPageForm.cmb_basic_traph_ext.value;//\u4e1a\u52a1\u7c7b\u578b
      routePageForm.traphExtNum.value=basicPageForm.edit_basic_traph_ext_id.value;//\u4e1a\u52a1\u7c7b\u578b
      routePageForm.mstpBandWidth.value=basicPageForm.edit_basic_bandwidthMstp.value;//\u5e26\u5bbd
    }

//\u5207\u6362\u8def\u7531\u4fe1\u606f\u65f6\u6761\u4ef6\u68c0\u67e5 \u8c03\u5ea6\u548c\u7535\u8def\u7f16\u8f91\u516c\u7528 liuyingnan 20061116
function checkSiteEqual(basicPage){
    var flag = true;
    var basicPageForm = basicPage.document.pBasicForm;

    var aCuid = basicPageForm.edit_name_a_cuid.value;//\u901a\u8fbe\u5730\u70b9Acuid
    var zCuid = basicPageForm.edit_name_z_cuid.value;//\u901a\u8fbe\u5730\u70b9Zcuid
    var aZdCuid = basicPageForm.edit_a_zdsite_cuid.value;//\u7ec8\u7aef\u7ad9\u70b9Acuid
    var zZdCuid = basicPageForm.edit_z_zdsite_cuid.value;//\u7ec8\u7aef\u7ad9\u70b9Zcuid
    var vTraphType = basicPageForm.cmb_basic_traph_type.value;//\u7535\u8def\u7c7b\u578b added by liuyingnan 070329 stamp MSTP \u7535\u8def\u8c03\u5ea6

    if(vTraphType =='2'){
      if(aZdCuid=='' || zZdCuid==''){
        flag=false;
        alert("\u7ec8\u7aef\u7ad9\u70b9\u4e0d\u5b8c\u6574")
        return flag;
      }
    }else{
       if(aZdCuid=='' || zZdCuid==''){
         flag = false;
         alert("\u7ec8\u7aef\u7ad9\u70b9\u4e0d\u5b8c\u6574\u6216\u91cd\u590d");
         return flag;
         }
       if(zCuid=='' || aCuid==''){
          flag = false;
          alert("\u901a\u8fbe\u5730\u70b9\u4e0d\u5b8c\u6574\u6216\u91cd\u590d");
          return flag;
        }
    }
    return flag;
  }
 ////\u83b7\u5f97\u8def\u7531\u8282\u70b9cuids \u8c03\u5ea6\u548c\u7535\u8def\u7f16\u8f91\u516c\u7528 liuyingnan 20061116
 function getRoutePointCuids(basicPage,tmpflag){
  var basicPageForm = basicPage.document.pBasicForm;
  var aCuid = '';//\u7ec8\u7aef\u7ad9\u70b9A
  var zCuid = '';//\u7ec8\u7aef\u7ad9\u70b9Z
  var cCuid = '';//\u8f6c\u63a5\u7ad9
  var aCuidOld = '';
  if (typeof(basicPageForm) != 'undefined'){
    aCuid=basicPageForm.edit_a_zdsite_cuid.value;
    aCuidOld = basicPageForm.edit_a_zdsite_cuid.value;
  }
  if (typeof(basicPageForm) != 'undefined'){
    zCuid=basicPageForm.edit_z_zdsite_cuid.value;
  }
  if (typeof(basicPageForm) != 'undefined'){
    cCuid = basicPageForm.edit_zjsites_cuid.value;
  }
  if(cCuid.length>0){
    aCuid+=','+cCuid;
  }
  if (zCuid != ''){
    aCuid+=','+zCuid;
  }
  //\u5982\u679c\u662f\u8c03\u6574\u7c7b\u578b\u7684\u7535\u8def\uff0c\u589e\u52a0\u8c03\u524d\u7535\u8def\u7684\u8def\u7531\u8282\u70b9\u7ad9\u4fe1\u606f \u8ba1\u7b97\u5904\u7406\u90e8\u95e8\u7528 added by liuyingnan 070410 waiting bug 3589 begin
  if(tmpflag!='1'){
    if (typeof(basicPage.parent.parent.viewPrePage) != 'undefined'){
            if (basicPage.parent.parent.attViewForm.relatedAZdSiteCuid != null
                && aCuidOld != basicPage.parent.parent.attViewForm.relatedAZdSiteCuid && aCuid.length > 0 ){
                aCuid += ','+basicPage.parent.parent.attViewForm.relatedAZdSiteCuid;//\u8c03\u524dA\u7aef\u7ec8\u7aef\u7ad9\u70b9
            }
            if (basicPage.parent.parent.attViewForm.zjsiteCuids != null
                && cCuid != basicPage.parent.parent.attViewForm.zjsiteCuids && aCuid.length > 0){
                aCuid += ','+basicPage.parent.parent.attViewForm.zjsiteCuids;//\u8c03\u524d\u8f6c\u63a5\u7ad9\u70b9 cuid \u9017\u53f7\u4e32
            }
            if (basicPage.parent.parent.attViewForm.relatedZZdSiteCuid != null
               && zCuid != basicPage.parent.parent.attViewForm.relatedZZdSiteCuid && aCuid.length > 0){
                aCuid += ','+basicPage.parent.parent.attViewForm.relatedZZdSiteCuid;//\u8c03\u524dZ\u7aef\u7ec8\u7aef\u7ad9\u70b9
            }
      }
 }
 //\u5982\u679c\u662f\u8c03\u6574\u7c7b\u578b\u7684\u7535\u8def\uff0c\u589e\u52a0\u8c03\u524d\u7535\u8def\u7684\u8def\u7531\u8282\u70b9\u7ad9\u4fe1\u606f \u8ba1\u7b97\u5904\u7406\u90e8\u95e8\u7528 added by liuyingnan 070410 waiting bug 3589 end
  return aCuid;

}
//\u5237\u65b0\u6587\u672c\u8def\u7531 \u8c03\u5ea6\u548c\u7535\u8def\u7f16\u8f91\u516c\u7528 \u517c\u5bb9\u5355\u6761\u7684\u81ea\u52a8\u8ba1\u7b97\u5904\u7406\u90e8\u95e8\u548c\u4e3b\u8c03 liuyingnan 20061116
function getPathInfoByRoutepoints(basicPage,manageStyle){
  var basicPageForm = '';
  if (typeof(basicPage.document.pBasicForm) != 'undefined'){
     basicPageForm = basicPage.document.pBasicForm;
  }else{
    basicPageForm = basicPage.document.pTraphBatBasForm;
  }
  var traphEditForm = new Object;
  var routePoints = '';
  routePoints = getRoutePointCuids(basicPage,'1');
  traphEditForm.routePoints = routePoints;
  if (typeof(basicPage.document.pBasicForm) != 'undefined'){
    traphEditForm.traphType = basicPage.document.pBasicForm.cmb_basic_traph_type.value;
  }
  if (routePoints != ''){
    if(basicPageForm.edit_zjsites_cuid.value!=''){
      traphEditForm.zjsiteCuids = basicPageForm.edit_zjsites_cuid.value;
      traphEditForm.zjsites = basicPageForm.edit_zjsites_name.value;
      traphEditForm.sign = basicPageForm.sign.value;
    }else{
      traphEditForm.zjsiteCuids = "";
      traphEditForm.zjsites = "";
      traphEditForm.sign = "";
    }
    TraphAjaxActionNew.getPathInfoByRoutepoints(traphEditForm,function(data){
      if (data != null){//\u8bbe\u7f6e\u6587\u672c\u8def\u7531\u9875\u9762\u663e\u793a
        if(data.textRouteInfo!=null){
          basicPageForm.area_pathinfo.value = data.textRouteInfo;
        }
        if (manageStyle == '2'){//\u8c03\u5ea6 \u9700\u8981\u81ea\u52a8\u8ba1\u7b97\u5904\u7406\u90e8\u95e8\u548c\u4e3b\u8c03 \u5355\u6761\u65f6
          traphEditForm.routePoints =getRoutePointCuids(basicPage,'2');
          autoGetHandleDeps(traphEditForm,1,'',basicPage,'');
          traphEditForm.routePoints =getRoutePointCuids(basicPage,'1');//\u6539\u56de\u6765
        }
      }
    });
  }
}
//\u81ea\u52a8\u8ba1\u7b97\u5904\u7406\u90e8\u95e8\u548c\u4e3b\u8c03 \u517c\u5bb9\u5355\u6761\u3001\u6279\u91cf\u548c\u6279\u91cf\u7f16\u8f91\u8def\u7531 liuyingnan 20061121
function autoGetHandleDeps(traphEditForm,iPatten,traphBatRouteForm,basicPage,iBatchEdit){
    TraphAjaxActionNew.autoGetHandleDeps(traphEditForm,function(data){
        if (data != null){
          setClbm(data,iPatten,traphBatRouteForm,basicPage,iBatchEdit);
        }
    });
}
//\u8bbe\u7f6e\u5904\u7406\u90e8\u95e8\u548c\u4e3b\u8c03\u7684\u9875\u9762\u663e\u793a \u517c\u5bb9\u5355\u6761\u3001\u6279\u91cf\u548c\u6279\u91cf\u7f16\u8f91\u8def\u7531 liuyingnan 20061121
function setClbm(form,iPatten,traphBatRouteForm,basicPage,iBatchEdit)//1\uff1a\u5355\u6761\uff1b2\uff1a\u6279\u91cf\uff1biBatchEdit = 1;//1:\u6279\u91cf\u65b0\u589e\uff1b2\uff1a\u6279\u91cf\u7f16\u8f91
{
  var list = '';
  var pAttempForm = '';
  if (iPatten =='1'){//\u5355\u6761
    pAttempForm = basicPage.parent.parent.tabbar.tabWindow("attemp").document.attempForm;
    list = pAttempForm.masterDep;
  }else if (iBatchEdit == '1'){//\u6279\u91cf\u65b0\u589e
    pAttempForm = basicPage.document.pTraphBatBasForm;
    list = pAttempForm.zdCombox;
  }
  //\u7ed9\u5904\u7406\u90e8\u95e8\u8d4b\u503c
  if (form.clbmCuid != null && form.clbmCuid != ''){
    if (iPatten =='1'){//\u5355\u6761
        pAttempForm.clbm.value =form.clbm;
        pAttempForm.clbmCuids.value = form.clbmCuid;
    }else if (iBatchEdit == '1'){//\u6279\u91cf\u65b0\u589e
        pAttempForm.clbmCn.value =form.clbm;
        pAttempForm.clbmT.value = form.clbmCuid;
    }
    if (iBatchEdit != '2'){//\u5355\u6761\u548c\u6279\u91cf\u65b0\u589e //\u6839\u636e\u5904\u7406\u90e8\u95e8\u4fe1\u606f\u7ed9\u4e3b\u8c03\u91cd\u65b0\u8d4b\u503c
        list.options.length = 0;
        var len =form.clbmCuid.split(",").length;
        addOptionToList(list,form.relatedMasterDgnDepName, form.relatedMasterDgnDepCuid);
        for (var i=0;i<len;i++){
            if ( form.relatedMasterDgnDepCuid != form.clbmCuid.split(",")[i]){
                addOptionToList(list,form.clbm.split(",")[i],form.clbmCuid.split(",")[i]);
            }
        }
    }
    if (iBatchEdit == '2'){//\u6279\u91cf\u7f16\u8f91\u8def\u7531\u65f6 \u7ed9\u5904\u7406\u90e8\u95e8\u548c\u4e3b\u8c03\u8d4b\u503c
        traphBatRouteForm.edit_clbmCn.value = form.clbm;
        traphBatRouteForm.edit_clbmValue.value = form.clbmCuid;
        traphBatRouteForm.edit_zdCn.value = form.relatedMasterDgnDepName;
        traphBatRouteForm.edit_zdValue.value =form.relatedMasterDgnDepCuid;
    }
  }else if(form.relatedMasterDgnDepCuid != null &&  form.relatedMasterDgnDepCuid!=""){
        if (iBatchEdit != '2'){//\u5355\u6761\u548c\u6279\u91cf\u65b0\u589e //\u6839\u636e\u5904\u7406\u90e8\u95e8\u4fe1\u606f\u7ed9\u4e3b\u8c03\u91cd\u65b0\u8d4b\u503c
        list.options.length = 0;
        addOptionToList(list,form.relatedMasterDgnDepName, form.relatedMasterDgnDepCuid);
        }
    }
}

//\u6279\u91cf\u7f16\u8f91\u8def\u7531 \u8c03\u5ea6\u548c\u7535\u8def\u7f16\u8f91\u516c\u7528 liuyingnan 20061117
function editTraphBatch(objectId,manageStyle) {//1\u4e3a\u7535\u8def\u7ba1\u7406\uff0c2\u4e3a\u8c03\u5ea6\u7ba1\u7406
  if(objectId!=null){
    if(objectId.split(",").length<2){
      alert("\u8bf7\u9009\u62e9\u81f3\u5c11\u4e24\u6761\u7535\u8def\u8fdb\u884c\u6279\u91cf\u7f16\u8f91\uff01");
    }else{
       TraphAjaxActionNew.isBatchModifyTraphsRoute(objectId,manageStyle,function(e){//\u8fd9\u91cc\u9762\u5224\u65ad\u4e86\u91cd\u4fdd\u7535\u8def,mstp\u7535\u8def
          if (e){
              url = "/webmaster/traph/uTraphBatch.jsp?manageStyle="+manageStyle+"&iPatten=2&&iBatchEdit=2&objId="+objectId;
              document.location = url;
          }
       });
       /*
        TraphAjaxActionNew.isContainImportantTraph(objectId,manageStyle,function(e){//added by liuyingnan 070809 \u91cd\u4fdd\u7535\u8def\u5224\u65ad betin
            if (e){
                alert("\u6279\u91cf\u9009\u62e9\u7684\u7535\u8def\u5305\u542b\u91cd\u4fdd\u7535\u8def\uff0c\u4e0d\u80fd\u6279\u91cf\u7f16\u8f91\u8def\u7531\uff01");
            }else{
                TraphAjaxActionNew.isContainMSTPTraph(objectId,manageStyle,function(e){//added by liuyingnan 070516 mstp\u7535\u8def\u7c7b\u578b\u5224\u65ad betin
                    if (e){
                        alert("\u6279\u91cf\u9009\u62e9\u7684\u7535\u8def\u5305\u542bMSTP\u7535\u8def\uff0c\u4e0d\u80fd\u6279\u91cf\u7f16\u8f91\u8def\u7531\uff01");
                    }else{
                        TraphAjaxActionNew.isBatchModifyTraphsRoute(objectId,manageStyle,function(e){
                            if (e){
                                url = "/webmaster/traph/uTraphBatch.jsp?manageStyle="+manageStyle+"&iPatten=2&&iBatchEdit=2&objId="+objectId;
                                document.location = url;
                            }
                        });
                    }
                });
            }
        });
        */
    }
  }else{
    alert("\u8bf7\u5148\u9009\u62e9\u7535\u8def");
  }
}


function copyOtherInfo(traphEditForm,pOtherForm){
if(traphEditForm!=null) {
   pOtherForm.reset();
   pOtherForm.cmb_protectModes.value = traphEditForm.protectMode;
    if (traphEditForm.serviceQuality != null) {
      pOtherForm.edit_serviceQuality.value = traphEditForm.serviceQuality; //\u670d\u52a1\u8d28\u91cf
    }
    if (traphEditForm.textRemarkInfo!=null){ //\u5176\u5b83\u4fe1\u606f\u4e2d\u7535\u8def\u5907\u6ce8 add by jej on 20060108
      pOtherForm.area_remarkinfo.value = traphEditForm.textRemarkInfo;//\u5176\u5b83\u4fe1\u606f\u7535\u8def\u5907\u6ce8
    }
    if (traphEditForm.dispathName != null) {
      pOtherForm.dispath_nameValue.value = traphEditForm.dispathName; //\u6587\u53f7
    }
    if (traphEditForm.isWholeRoute == true) {
      pOtherForm.chk_isWholeRoute.checked = "true"; //\u8def\u7531\u662f\u5426\u5b8c\u6574
    }
    if (traphEditForm.zjdfPorts != null) {
      pOtherForm.edit_zjdfPorts.value = traphEditForm.zjdfPorts; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if(traphEditForm.isProrityMonitorsTraph == true){
    pOtherForm.chk_isPriorityTraph.checked = true;
    }
    if (traphEditForm.stopTime != null) {
      pOtherForm.stop_time.value = traphEditForm.stopTime; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if (traphEditForm.longDistanceTraphName != null) {
      pOtherForm.edit_distance_name.value = traphEditForm.longDistanceTraphName; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if (traphEditForm.businessDiscussedTraphName != null) {
      pOtherForm.edit_business_name.value = traphEditForm.businessDiscussedTraphName; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if (traphEditForm.cutomerTraphname != null) {
      pOtherForm.edit_customer_name.value = traphEditForm.cutomerTraphname; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if(traphEditForm.isTestTraph == true){ //\u662f\u5426\u6d4b\u8bd5\u7535\u8def
    pOtherForm.chk_isTestTraph.checked = true;
    }
    //\u56fd\u9645\u7535\u8def
    if (traphEditForm.cable != null) {
        pOtherForm.edit_cabel_name.value = traphEditForm.cable;
    }
    pOtherForm.edit_yuan_name.value = traphEditForm.rentYuan
    pOtherForm.edit_usd_name.value = traphEditForm.rentUSD;
    if(traphEditForm.term != null && traphEditForm.term != "" && traphEditForm.term != 0){
      pOtherForm.cmb_othre_traph_term.value = traphEditForm.term;
    }

    showInterTraph(traphEditForm.traphLevel);
    }
}

function viewTraphDetailInfo(traphEditForm,pBasicForm){
if(traphEditForm!=null) {
    pBasicForm.cmb_basic_traph_levelStr.value = traphEditForm.traphLevelStr; //\u7535\u8def\u7ea7\u522b
    pBasicForm.importLevelStr.value = traphEditForm.importLevelStr; //\u91cd\u8981\u6027
    pBasicForm.cmb_basic_traph_ownerStr.value = traphEditForm.ownerShipStr;//\u4ea7\u6743
    pBasicForm.edit_traph_name.value = traphEditForm.labelCn; //\u7535\u8def\u540d\u79f0
    pBasicForm.edit_name_a.value = traphEditForm.endStationA; //\u901a\u8fbe\u5730\u70b9A\u540d\u79f0
    pBasicForm.edit_name_z.value = traphEditForm.endStationZ; //\u901a\u8fbe\u5730\u70b9Z\u540d\u79f0
    pBasicForm.edit_basic_traph_number.value = traphEditForm.no;//\u7535\u8def\u7f16\u53f7
    pBasicForm.cmb_basic_traph_useStr.value = traphEditForm.useTypeStr;//\u7535\u8def\u7528\u9014
    if(traphEditForm.extDescs ==null){
        pBasicForm.cmb_basic_traph_ext.value ='';
        pBasicForm.cmb_basic_traph_ext.title ='';
    }else{
        pBasicForm.cmb_basic_traph_ext.value = traphEditForm.extDescs;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578b\u82f1\u6587\u63cf\u8ff0
        pBasicForm.cmb_basic_traph_ext.title = traphEditForm.extDescs;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578b\u82f1\u6587\u63cf\u8ff0hint\u63d0\u793a\u4fe1\u606f
    }
    if (traphEditForm.alias != null) {
      pBasicForm.edit_basic_traph_alias.value = traphEditForm.alias; //\u7535\u8def\u522b\u540d
    }
    if (traphEditForm.endDfPortA != null) {
      pBasicForm.edit_end_df_portA.value = traphEditForm.endDfPortA; //A\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.endDfPortZ != null) {
      pBasicForm.edit_end_df_portZ.value =traphEditForm.endDfPortZ; //Z\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.extpath1A != null) {
      pBasicForm.area_extpath1A.value = traphEditForm.extpath1A; //A\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
    }
    if (traphEditForm.extpath1Z != null) {
      pBasicForm.area_extpath1Z.value = traphEditForm.extpath1Z; //Z\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
    }
    if (traphEditForm.jhroomA != null) {
      pBasicForm.edit_jhroomA.value = traphEditForm.jhroomA; //A\u7aef\u4e1a\u52a1\u673a\u623f
    }
    if (traphEditForm.jhroomZ != null) {
      pBasicForm.edit_jhroomZ.value = traphEditForm.jhroomZ; //Z\u7aef\u4e1a\u52a1\u673a\u623f
    }
    if (traphEditForm.notes != null) {
      pBasicForm.edit_basic_traph_memo.value = traphEditForm.notes; //\u7535\u8def\u5907\u6ce8
    }
    if (traphEditForm.endSwitchDevA != null) {
      pBasicForm.edit_endSwitchDevA.value = traphEditForm.endSwitchDevA;//A\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
    }
    if (traphEditForm.endSwitchDevZ != null) {
      pBasicForm.edit_endSwitchDevZ.value = traphEditForm.endSwitchDevZ;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
    }
    if (traphEditForm.endSwitchdevPortA != null) {
      pBasicForm.edit_endSwitchdevPortA.value = traphEditForm.endSwitchdevPortA; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
    }
    if (traphEditForm.endSwitchdevPortZ != null) {
      pBasicForm.edit_endSwitchdevPortZ.value = traphEditForm.endSwitchdevPortZ; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
    }
    if (traphEditForm.relatedAZdSiteName != null) {
      pBasicForm.edit_a_zdsite_name.value = traphEditForm.relatedAZdSiteName; //A\u7aef\u7ec8\u7aef\u7ad9\u70b9\u540d\u79f0
    }
    if (traphEditForm.relatedZZdSiteName != null) {
      pBasicForm.edit_z_zdsite_name.value = traphEditForm.relatedZZdSiteName; //Z\u7aef\u7ec8\u7aef\u7ad9\u70b9\u540d\u79f0
    }
    if(traphEditForm.traphTypeStr!=null && traphEditForm.traphTypeStr=='MSTP\u7535\u8def'){
    if (traphEditForm.endPortA != null) {//A\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
    pBasicForm.edit_macPortA.value = traphEditForm.endPortA;
    }
    if (traphEditForm.endPortZ != null) {//Z\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
    pBasicForm.edit_macPortZ.value = traphEditForm.endPortZ;
    }
    }
    if (traphEditForm.endVctrunkA != null) {//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
      pBasicForm.edit_vctrunkPortA.value = traphEditForm.endVctrunkA;
    }
    if (traphEditForm.endVctrunkZ != null) {//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
      pBasicForm.edit_vctrunkPortZ.value = traphEditForm.endVctrunkZ;
    }
    if (traphEditForm.endVlanidA != null) {//A\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
      pBasicForm.edit_vlanidA.value = traphEditForm.endVlanidA;
    }
    if (traphEditForm.endVlanidZ != null) {//Z\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
      pBasicForm.edit_vlanidZ.value = traphEditForm.endVlanidZ;
    }
    if (traphEditForm.userName != null) {
      pBasicForm.cmb_basic_traph_sp.value = traphEditForm.userName; //\u51fa\u79df\u7528\u6237
      pBasicForm.cmb_basic_traph_sp.title = traphEditForm.userName;
    }
    if (traphEditForm.requestDateToString != null) {
      pBasicForm.edit_basic_plan_datetime.value = traphEditForm.requestDateToString; //\u8981\u6c42\u65f6\u95f4
    }
    if (traphEditForm.usedDateToString != null) {
      pBasicForm.edit_basic_real_datetime.value = traphEditForm.usedDateToString; //\u5f00\u901a\u65f6\u95f4
    }
    if (traphEditForm.sdxc1A != null) {
      pBasicForm.edit_sdxc1A.value =traphEditForm.sdxc1A; //A\u7aefSDXC1
    }
    if (traphEditForm.sdxc1Z != null) {
      pBasicForm.edit_sdxc1Z.value = traphEditForm.sdxc1Z; //Z\u7aefSDXC1
    }
    if (traphEditForm.sdxc2A != null) {
      pBasicForm.edit_sdxc2A.value = traphEditForm.sdxc2A; //A\u7aefSDXC2
    }
    if (traphEditForm.sdxc2Z != null) {
      pBasicForm.edit_sdxc2Z.value = traphEditForm.sdxc2Z; //Z\u7aefSDXC2
    }
    //alert('s7');
    if (traphEditForm.zjdfA != null) {
      pBasicForm.edit_zjdfA.value = traphEditForm.zjdfA; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.zjdfZ != null) {
      pBasicForm.edit_zjdfZ.value = traphEditForm.zjdfZ; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
    }

    if (traphEditForm.endSwitchDfPortA != null) {
      pBasicForm.edit_endSwitchDfPortA.value = traphEditForm.endSwitchDfPortA; //A\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.endSwitchDfPortZ != null) {
      pBasicForm.edit_endSwitchDfPortZ.value = traphEditForm.endSwitchDfPortZ; //Z\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.pathinfo != null) {
      pBasicForm.area_pathinfo.value = traphEditForm.pathinfo; //\u8def\u7531\u63cf\u8ff0\u4fe1\u606f
    }
    if(traphEditForm.traphType==3 && traphEditForm.bandWidth != null){ //add by wangyisong 070418 \u4fee\u6539MSTP\u7535\u8def\u5e26\u5bbd\u8d4b\u503c
        pBasicForm.edit_basic_bandwidthMstp.value = traphEditForm.bandWidth;//MSTP\u5e26\u5bbd

    }
    if(traphEditForm.traphRate !=null && traphEditForm.traphRate !=0 ){
        pBasicForm.cmb_basic_traph_speedStr.value=traphEditForm.traphRateStr;
    }
    if(traphEditForm.traphType!=null && traphEditForm.traphType !=0){
        pBasicForm.cmb_basic_traph_typeStr.value=traphEditForm.traphTypeStr;
    }

 //\u521d\u59cb\u5316\u57fa\u7ad9\u53f7
  var cuid = traphEditForm.relatedAZdSiteCuid;
  if(cuid!=null && typeof(cuid)!='undefined'){
    if(cuid.indexOf("SITE") != -1){
      TraphAjaxActionNew.getSiteCoding(cuid,function(data){
        pBasicForm.A_SITECODING.value = data;
      });
    }
  }
  var cuidZ = traphEditForm.relatedZZdSiteCuid;
  if(cuidZ!=null && typeof(cuidZ)!='undefined'){
  if(cuidZ.indexOf("SITE") != -1){
    TraphAjaxActionNew.getSiteCoding(cuidZ,function(data){
      pBasicForm.Z_SITECODING.value = data;
    });
   }
  }
    if (traphEditForm.textRemarkInfo!=null){ //\u5176\u5b83\u4fe1\u606f\u4e2d\u7535\u8def\u5907\u6ce8 add by jej on 20060108
      pBasicForm.area_remarkinfo.value = traphEditForm.textRemarkInfo;//\u5176\u5b83\u4fe1\u606f\u7535\u8def\u5907\u6ce8
    }
    if (traphEditForm.dispathName != null) {
      pBasicForm.dispath_nameValue.value = traphEditForm.dispathName; //\u6587\u53f7
    }
    if (traphEditForm.zjdfPorts != null) {
      pBasicForm.edit_zjdfPorts.value = traphEditForm.zjdfPorts; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if(traphEditForm.isProrityMonitorsTraph == true){
    pBasicForm.chk_isPriorityTraph.checked = true;
    }

    if (traphEditForm.longDistanceTraphName != null) {
      pBasicForm.edit_distance_name.value = traphEditForm.longDistanceTraphName; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if (traphEditForm.businessDiscussedTraphName != null) {
      pBasicForm.edit_business_name.value = traphEditForm.businessDiscussedTraphName; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
    if (traphEditForm.cutomerTraphname != null) {
      pBasicForm.edit_customer_name.value = traphEditForm.cutomerTraphname; //\u8f6c\u63a5\u914d\u7ebf\u67b6
    }
  }
}

function copyBasicInfo(traphEditForm,pBasicForm,manageStyle){
if(traphEditForm!=null) {
pBasicForm.reset();
    if(traphEditForm.traphLevel !=0){
        pBasicForm.cmb_basic_traph_level.value = traphEditForm.traphLevel; //\u7535\u8def\u7ea7\u522b
    }
    pBasicForm.importLevel.value = traphEditForm.importLevel; //\u91cd\u8981\u6027
    if(traphEditForm.ownership !=0){
        pBasicForm.cmb_basic_traph_owner.value = traphEditForm.ownership;//\u4ea7\u6743
    }
    pBasicForm.edit_traph_name.value = traphEditForm.labelCn; //\u7535\u8def\u540d\u79f0
    pBasicForm.edit_name_a_cuid.value = traphEditForm.relatedAEndStationCuid; //\u901a\u8fbe\u5730\u70b9ACUID
    pBasicForm.edit_name_z_cuid.value = traphEditForm.relatedZEndStationCuid; //\u901a\u8fbe\u5730\u70b9ZCUID
    pBasicForm.edit_name_a.value = traphEditForm.endStationA; //\u901a\u8fbe\u5730\u70b9A\u540d\u79f0
    pBasicForm.edit_name_z.value = traphEditForm.endStationZ; //\u901a\u8fbe\u5730\u70b9Z\u540d\u79f0
    pBasicForm.edit_basic_traph_number.value = traphEditForm.no;//\u7535\u8def\u7f16\u53f7
    pBasicForm.edit_basic_traph_ext_id.value = traphEditForm.extIds;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578bid
    pBasicForm.cmb_basic_traph_use.value = traphEditForm.useType;//\u7535\u8def\u7528\u9014
    if(traphEditForm.extDescs ==null){
        pBasicForm.cmb_basic_traph_ext.value ='';
        pBasicForm.cmb_basic_traph_ext.title ='';
    }else{
        pBasicForm.cmb_basic_traph_ext.value = traphEditForm.extDescs;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578b\u82f1\u6587\u63cf\u8ff0
        pBasicForm.cmb_basic_traph_ext.title = traphEditForm.extDescs;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578b\u82f1\u6587\u63cf\u8ff0hint\u63d0\u793a\u4fe1\u606f
    }
    if (traphEditForm.alias != null) {
      pBasicForm.edit_basic_traph_alias.value = traphEditForm.alias; //\u7535\u8def\u522b\u540d
    }
    if (traphEditForm.endDfPortA != null) {
      pBasicForm.edit_end_df_portA.value = traphEditForm.endDfPortA; //A\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.endDfPortZ != null) {
      pBasicForm.edit_end_df_portZ.value =traphEditForm.endDfPortZ; //Z\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.extpath1A != null) {
      pBasicForm.area_extpath1A.value = traphEditForm.extpath1A; //A\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
    }
    if (traphEditForm.extpath1Z != null) {
      pBasicForm.area_extpath1Z.value = traphEditForm.extpath1Z; //Z\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
    }
    if (traphEditForm.jhroomA != null) {
      pBasicForm.edit_jhroomA.value = traphEditForm.jhroomA; //A\u7aef\u4e1a\u52a1\u673a\u623f
    }
    if (traphEditForm.jhroomZ != null) {
      pBasicForm.edit_jhroomZ.value = traphEditForm.jhroomZ; //Z\u7aef\u4e1a\u52a1\u673a\u623f
    }
    /*
    if (traphEditForm.notes != null) {
        if(traphEditForm.traphType!=3){
            pBasicForm.edit_basic_traph_memo.value = traphEditForm.notes; //\u7535\u8def\u5907\u6ce8
        }else {
            pBasicForm.edit_basic_traph_memoMstp.value = traphEditForm.notes; //\u7535\u8def\u5907\u6ce8 Mstp
        }
    }
    */
    if (traphEditForm.notes != null) {
      pBasicForm.edit_basic_traph_memo.value = traphEditForm.notes; //\u7535\u8def\u5907\u6ce8
    }
    if (traphEditForm.relatedAEndSwitchdevCuid != null) {
      pBasicForm.edit_endSwitchDevA_cuid.value = traphEditForm.relatedAEndSwitchdevCuid; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
    }
    if (traphEditForm.relatedZEndSwitchdevCuid != null) {
      pBasicForm.edit_endSwitchDevZ_cuid.value = traphEditForm.relatedZEndSwitchdevCuid; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
    }
    if (traphEditForm.endSwitchDevA != null) {
      pBasicForm.edit_endSwitchDevA.value = traphEditForm.endSwitchDevA;//A\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
    }
    if (traphEditForm.endSwitchDevZ != null) {
      pBasicForm.edit_endSwitchDevZ.value = traphEditForm.endSwitchDevZ;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
    }
    if (traphEditForm.relatedAEndSwitchPortCuid != null) {
      pBasicForm.edit_endSwitchdevPortACuid.value = traphEditForm.relatedAEndSwitchPortCuid; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
    }
    if (traphEditForm.relatedZEndSwitchPortCuid != null) {
      pBasicForm.edit_endSwitchdevPortZCuid.value = traphEditForm.relatedZEndSwitchPortCuid; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
    }
    if (traphEditForm.transPortACuid != null) {
      pBasicForm.edit_transPortACuid.value = traphEditForm.transPortACuid; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3CUID
    }
    if (traphEditForm.transPortZCuid != null) {
      pBasicForm.edit_transPortZCuid.value = traphEditForm.transPortZCuid; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3CUID
    }
    if (traphEditForm.transPortAName != null) {
      pBasicForm.edit_transPortAName.value = traphEditForm.transPortAName; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3
    }
    if (traphEditForm.transPortZName != null) {
      pBasicForm.edit_transPortZName.value = traphEditForm.transPortZName; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3
    }
    //alert('s5');
    if (traphEditForm.endSwitchdevPortA != null) {
      pBasicForm.edit_endSwitchdevPortA.value = traphEditForm.endSwitchdevPortA; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
    }
    if (traphEditForm.endSwitchdevPortZ != null) {
      pBasicForm.edit_endSwitchdevPortZ.value = traphEditForm.endSwitchdevPortZ; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
    }
    if (traphEditForm.relatedAZdSiteCuid != null) {
      pBasicForm.edit_a_zdsite_cuid.value = traphEditForm.relatedAZdSiteCuid; //A\u7aef\u7ec8\u7aef\u7ad9\u70b9
    }
    if (traphEditForm.relatedZZdSiteCuid != null) {
      pBasicForm.edit_z_zdsite_cuid.value = traphEditForm.relatedZZdSiteCuid; //Z\u7aef\u7ec8\u7aef\u7ad9\u70b9
    }
    if (traphEditForm.relatedAZdSiteName != null) {
      pBasicForm.edit_a_zdsite_name.value = traphEditForm.relatedAZdSiteName; //A\u7aef\u7ec8\u7aef\u7ad9\u70b9\u540d\u79f0
    }
    if (traphEditForm.relatedZZdSiteName != null) {
      pBasicForm.edit_z_zdsite_name.value = traphEditForm.relatedZZdSiteName; //Z\u7aef\u7ec8\u7aef\u7ad9\u70b9\u540d\u79f0
    }
    //added by liuyingnan 070328 MSTP \u7535\u8def\u8c03\u5ea6 \u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u5c5e\u6027 begin
            if (traphEditForm.endPortA != null) {//A\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
                pBasicForm.edit_macPortA.value = traphEditForm.endPortA;
            }
            if (traphEditForm.relatedAMacPortCuid != null) {//A\u7aef\u4f20\u8f93\u7aef\u53e3cuid \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
                 pBasicForm.edit_macPortACuid.value = traphEditForm.relatedAMacPortCuid;
            }
            if (traphEditForm.endPortZ != null) {//Z\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
                pBasicForm.edit_macPortZ.value = traphEditForm.endPortZ;
            }
            if (traphEditForm.relatedZMacPortCuid != null) {//A\u7aef\u4f20\u8f93\u7aef\u53e3cuid \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
                 pBasicForm.edit_macPortZCuid.value = traphEditForm.relatedZMacPortCuid;
            }
            if (traphEditForm.endVctrunkA != null) {//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
               pBasicForm.edit_vctrunkPortA.value = traphEditForm.endVctrunkA;
           }
           if (traphEditForm.relatedAVctrunkCuid != null) {//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3CUID
               pBasicForm.edit_vctrunkPortA_cuid.value = traphEditForm.relatedAVctrunkCuid;
           }
           if (traphEditForm.endVctrunkZ != null) {//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
               pBasicForm.edit_vctrunkPortZ.value = traphEditForm.endVctrunkZ;
           }
           if (traphEditForm.relatedZVctrunkCuid != null) {//Z\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3CUID
               pBasicForm.edit_vctrunkPortZ_cuid.value = traphEditForm.relatedZVctrunkCuid;
           }
           if (traphEditForm.endVlanidA != null) {//A\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
              pBasicForm.edit_vlanidA.value = traphEditForm.endVlanidA;
          }
           if (traphEditForm.endVlanidZ != null) {//Z\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
              pBasicForm.edit_vlanidZ.value = traphEditForm.endVlanidZ;
          }
          //added by liuyingnan 070328 MSTP \u7535\u8def\u8c03\u5ea6 \u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u5c5e\u6027 end
    //alert('s6');
    if (traphEditForm.userName != null) {
      pBasicForm.cmb_basic_traph_sp.value = traphEditForm.userName; //\u51fa\u79df\u7528\u6237
      pBasicForm.cmb_basic_traph_sp.title = traphEditForm.userName;
    }
    if(traphEditForm.userCuid != null){
    pBasicForm.cmb_basic_traph_sp_cuid.value = traphEditForm.userCuid; //\u51fa\u79df\u7528\u6237
    }
    if (manageStyle !=2){//\u7535\u8def\u7f16\u8f91
        if (traphEditForm.requestDateToString != null) {
            pBasicForm.edit_basic_plan_datetime.value = traphEditForm.requestDateToString; //\u8981\u6c42\u65f6\u95f4
        }
        if (traphEditForm.usedDateToString != null) {
            pBasicForm.edit_basic_real_datetime.value = traphEditForm.usedDateToString; //\u5f00\u901a\u65f6\u95f4
        }
    }
    if (traphEditForm.sdxc1A != null) {
      pBasicForm.edit_sdxc1A.value =traphEditForm.sdxc1A; //A\u7aefSDXC1
    }
    if (traphEditForm.sdxc1Z != null) {
      pBasicForm.edit_sdxc1Z.value = traphEditForm.sdxc1Z; //Z\u7aefSDXC1
    }
    if (traphEditForm.sdxc2A != null) {
      pBasicForm.edit_sdxc2A.value = traphEditForm.sdxc2A; //A\u7aefSDXC2
    }
    if (traphEditForm.sdxc2Z != null) {
      pBasicForm.edit_sdxc2Z.value = traphEditForm.sdxc2Z; //Z\u7aefSDXC2
    }
    //alert('s7');
    if (traphEditForm.zjdfA != null) {
      pBasicForm.edit_zjdfA.value = traphEditForm.zjdfA; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.zjdfZ != null) {
      pBasicForm.edit_zjdfZ.value = traphEditForm.zjdfZ; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.zjsites != null) {
      pBasicForm.edit_zjsites_name.value = traphEditForm.zjsites; //\u8f6c\u63a5\u7ad9\u540d
    }
    if (traphEditForm.zjsiteCuids != null) {
      pBasicForm.edit_zjsites_cuid.value = traphEditForm.zjsiteCuids; //\u8f6c\u63a5\u7ad9cuid\u9017\u53f7\u4e32
    }
    if (traphEditForm.zjsitesInternational != null) {
      pBasicForm.edit_zjsites_name_international.value = traphEditForm.zjsitesInternational;
    }
    if (traphEditForm.endSwitchDfPortA != null) {
      pBasicForm.edit_endSwitchDfPortA.value = traphEditForm.endSwitchDfPortA; //A\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.endSwitchDfPortZ != null) {
      pBasicForm.edit_endSwitchDfPortZ.value = traphEditForm.endSwitchDfPortZ; //Z\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
    }
    if (traphEditForm.pathinfo != null) {
      pBasicForm.area_pathinfo.value = traphEditForm.pathinfo; //\u8def\u7531\u63cf\u8ff0\u4fe1\u606f
    }
    if(traphEditForm.traphType==3 && traphEditForm.bandWidth != null){ //add by wangyisong 070418 \u4fee\u6539MSTP\u7535\u8def\u5e26\u5bbd\u8d4b\u503c
        pBasicForm.edit_basic_bandwidthMstp.value = traphEditForm.bandWidth;//MSTP\u5e26\u5bbd

    }
    if(traphEditForm.traphRate !=null && traphEditForm.traphRate !=0 ){
        pBasicForm.cmb_basic_traph_speed.value=traphEditForm.traphRate;
    }
    if(traphEditForm.traphType!=null && traphEditForm.traphType !=0){    //\u7535\u8def\u7c7b\u578b
        pBasicForm.cmb_basic_traph_type.value=traphEditForm.traphType;
    }
	if(traphEditForm.pathinfoRemark!=null){//pathinfoRemak add by liuzhongxiang 2009-1-15
		pBasicForm.area_pathinfo_remark.value = traphEditForm.pathinfoRemark;
	}//end
	if(traphEditForm.zjsitesInternational!=null){
		pBasicForm.edit_zjsites_name_international.value=traphEditForm.zjsitesInternational;
	}
	if(traphEditForm.leaseType!=null && traphEditForm.leaseType!="" && traphEditForm.leaseType!=0){
		pBasicForm.LEASE_TYPE.value=traphEditForm.leaseType;
	}
	if(traphEditForm.dcme!=null){
		pBasicForm.DCME.value=traphEditForm.dcme;
	}
  }
}


//\u65b0\u589e\u4fee\u6539\u4fdd\u5b58\u7535\u8def\u4fe1\u606f wangyisong 061110 \u8be5\u65b9\u6cd5\u652f\u6301\u8fde\u7eed\u65b0\u589e
function saveTraphInfo(btnName,pBasicForm,pOtherForm,src,isDeleteTransPath){
  var traphEditForm = new Object;
  //pBasicForm.btn_zjsites_name.setFocused(true);//\u4f5c\u7528\u7535\u8def\u540d\u79f0\u624b\u52a8\u5220\u9664\u4ee5\u53ca\u5237\u65b0
//  if (pBasicForm.edit_traph_name.value == null || pBasicForm.edit_traph_name.value == "") {
//    alert("\u7535\u8def\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a!");
//    src.disabled='';
//    pInfoForm.btn_mulAdd.disabled='';
//    pInfoForm.btn_cancel.disabled='';
//    return;
//  }
  if (pBasicForm.edit_name_a_cuid.value == null || pBasicForm.edit_name_a_cuid.value == "" || pBasicForm.edit_name_z_cuid == null || pBasicForm.edit_name_z_cuid == "") {
    alert("\u901a\u8fbe\u5730\u70b9\u4e0d\u80fd\u4e3a\u7a7a!");
     src.disabled='';
     pInfoForm.btn_mulAdd.disabled='';
     pInfoForm.btn_cancel.disabled='';
    return;
  }
  if (pBasicForm.edit_name_a_cuid.value == null || pBasicForm.edit_name_a_cuid.value == "" || pBasicForm.edit_name_z_cuid == null || pBasicForm.edit_name_z_cuid == "") {
    alert("\u901a\u8fbe\u5730\u70b9\u4e0d\u80fd\u4e3a\u7a7a!");
     src.disabled='';
     pInfoForm.btn_mulAdd.disabled='';
     pInfoForm.btn_cancel.disabled='';
    return;
  }

//  if(pBasicForm.cmb_basic_traph_type.value!=2){
//    if (pBasicForm.edit_name_a_cuid.value == pBasicForm.edit_name_z_cuid.value) {
//    alert("\u901a\u8fbe\u5730\u70b9\u4e0d\u80fd\u76f8\u540c!");
//    src.disabled='';
//    pInfoForm.btn_mulAdd.disabled='';
//    pInfoForm.btn_cancel.disabled='';
//    return;
//   }
//  }

  //\u5224\u65ad\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e added by liuyingnan stamp mstp \u7535\u8def\u8c03\u5ea6
   var vTraphType = pBasicForm.cmb_basic_traph_type.value;//\u7535\u8def\u7c7b\u578b added by liuyingnan 070329 stamp MSTP \u7535\u8def\u8c03\u5ea6
   //vTraphType =='3' mstp\u7535\u8def\u7c7b\u578b
   //delete by wanglanqiao 2008-05-13
/*
   if (vTraphType =='3'){
    if(!((pBasicForm.edit_macPortACuid.value != ""
       && pBasicForm.edit_vctrunkPortA_cuid.value != ""
       && pBasicForm.edit_vlanidA.value != "") || (pBasicForm.edit_macPortZCuid.value != ""
       && pBasicForm.edit_vctrunkPortZ_cuid.value != ""
       && pBasicForm.edit_vlanidZ.value != ""))){
       alert("\u8bf7\u81f3\u5c11\u5b8c\u6574\u586b\u5199\u4e00\u7aef\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u4fe1\u606f\uff01");
       src.disabled='';
       pInfoForm.btn_mulAdd.disabled='';
       pInfoForm.btn_cancel.disabled='';
       return;
    }
    if(pBasicForm.edit_macPortACuid.value != "" &&
        (pBasicForm.edit_vctrunkPortA_cuid.value == "" ||pBasicForm.edit_vlanidA.value == "")){
        alert('\u8bf7\u5c06A\u7aef\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u4fe1\u606f\u586b\u5199\u5b8c\u6574\uff0c\n\u5982\u586b\u5199MAC\u7aef\u53e3\uff0cMP\u53e3\u3001VlanId\u4e0d\u53ef\u4e3a\u7a7a\uff01');
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
    }
    if(pBasicForm.edit_macPortZCuid.value != "" &&
        (pBasicForm.edit_vctrunkPortZ_cuid.value == "" ||pBasicForm.edit_vlanidZ.value == "")){
        alert('\u8bf7\u5c06Z\u7aef\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u4fe1\u606f\u586b\u5199\u5b8c\u6574\uff0c\n\u5982\u586b\u5199MAC\u7aef\u53e3\uff0cMP\u53e3\u3001VlanId\u4e0d\u53ef\u4e3a\u7a7a\uff01');
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
    }
   }
*/

    /*
    if(pBasicForm.edit_macPortACuid.value == "" || pBasicForm.edit_vctrunkPortA_cuid.value == "" ||
        pBasicForm.edit_vlanidA.value == "" || pBasicForm.edit_macPortZCuid.value == "" ||
        pBasicForm.edit_vctrunkPortZ_cuid.value == "" || pBasicForm.edit_vlanidZ.value == ""){
        alert("\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u4fe1\u606f\u5fc5\u987b\u586b\u5199\u5b8c\u6574\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
    }
    */
   var vBandWidth = '';// \u5e26\u5bbd Mstp
   //delete by wanglanqiao 2008-05-13
   /*
   if(pBasicForm.cmb_basic_traph_type.value == 3){
        vBandWidth = pBasicForm.edit_basic_bandwidthMstp.value;//MSTP \u5e26\u5bbd
        if (vBandWidth == null || vBandWidth == ""){ //add by wangyisong 070418 MSTP\u7535\u8def\u5e26\u5bbd\u5fc5\u987b\u586b\u5199
            alert("MSTP\u7535\u8def\u5e26\u5bbd\u4e0d\u80fd\u4e3a\u7a7a!");
            src.disabled='';
            pInfoForm.btn_mulAdd.disabled='';
            pInfoForm.btn_cancel.disabled='';
            return;
        }
     }
     */
  if (pBasicForm.edit_basic_traph_number.value == null || pBasicForm.edit_basic_traph_number.value == "") {
    alert("\u7535\u8def\u7f16\u53f7\u4e0d\u80fd\u4e3a\u7a7a!");
     src.disabled='';
     pInfoForm.btn_mulAdd.disabled='';
     pInfoForm.btn_cancel.disabled='';
    return;
  }
  if(!integerValidator(pBasicForm.edit_basic_traph_number.value,false)){
    alert("\u7535\u8def\u7f16\u53f7\u5e94\u8be5\u4e3a\u6570\u5b57!");
    pBasicForm.edit_basic_traph_number.value = "";
     src.disabled='';
     pInfoForm.btn_mulAdd.disabled='';
     pInfoForm.btn_cancel.disabled='';
    return;
  }
  src.disabled='disabled';
  pInfoForm.btn_mulAdd.disabled='disabled';
  pInfoForm.btn_cancel.disabled='disabled';
  traphToForm(traphEditForm,pBasicForm,pOtherForm);
  if (btnName =='btn_modify' || btnName == 'modify'){
    var isDeleteTransPathFalg = false;
    if(isDeleteTransPath){
        if (confirm("\u60a8\u786e\u8ba4\u5220\u9664\u7535\u8def\u91ca\u653e\u7684\u901a\u9053\u5417\uff1f")){
          isDeleteTransPathFalg = true;
        }
    }
    TraphAjaxActionNew.saveModifyTraphInfo(traphEditForm, isDeleteTransPathFalg,function(e){
      //\u5e76\u53d1\u5904\u7406 added by liuyingnan 070123 begin stamp \u7aef\u53e3\u8c03\u5ea6
      if (e == "-3") {
        alert("\u901a\u9053\u8d44\u6e90\u5df2\u88ab\u5176\u4ed6\u7535\u8def\u5360\u7528,\u8bf7\u91cd\u65b0\u8bbe\u8ba1\u8def\u7531\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
      }
      if (e == "-4") {
        alert("CTP\u8d44\u6e90\u5df2\u88ab\u5176\u4ed6\u901a\u9053\u5360\u7528,\u8bf7\u91cd\u65b0\u8bbe\u8ba1\u8def\u7531\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
      }
      if (e == "-7") {
        alert("\u901a\u9053\u4e0d\u80fd\u6b63\u786e\u5360\u7528\u8d44\u6e90\uff0c\u8bf7\u5c06\u4e00\u7aefCTP\u9009\u62e9\u5230\u4e0e\u901a\u9053\u7b49\u901f\u7387\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
      }
      if (e == "-5") {
        alert("A\u7aef\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u88ab\u5360\u7528\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
      }
      if (e == "-6") {
        alert("Z\u7aef\u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u88ab\u5360\u7528\uff01");
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        return;
      }
      if (btnName == 'btn_modify') {
        document.location = "/webmaster/traph/traphIndex.jsp?refreshType=addTraph";
      }
    tabbar.setTabActive("traphBasic");//\u8bbe\u7f6e\u6210\u9ed8\u8ba4\u57fa\u7840\u9875
   })
  }else{
    TraphAjaxActionNew.saveTraphInfo(traphEditForm,
    {callback:function(e){
      if (e != "") {
        var arr = e.split("&");
        if(arr.length>1){
          alert(arr[1]);
          src.disabled='';
          pInfoForm.btn_mulAdd.disabled='';
          pInfoForm.btn_cancel.disabled='';
          return;
        }
      }
      if (btnName == 'btn_add') {
        document.location = "/webmaster/traph/traphIndex.jsp?refreshType=addTraph";
      }
    tabbar.setTabActive("traphBasic");//\u8bbe\u7f6e\u6210\u9ed8\u8ba4\u57fa\u7840\u9875
    },
    errorHandler:function(e) {
        src.disabled='';
        pInfoForm.btn_mulAdd.disabled='';
        pInfoForm.btn_cancel.disabled='';
        alert(e);
        return;
    }})
  }
}

//\u7535\u8def\u7f16\u8f91\u4f7f\u7528\uff0c\u4ece\u9875\u9762\u8d4b\u503c\u7ed9FormBean wangyisong 061110
function traphToForm(form,pBasicForm,pOtherForm) {
  //alert("s1");
  form.labelCn = pBasicForm.edit_traph_name.value; //\u7535\u8def\u540d\u79f0
  form.relatedAEndStationCuid = pBasicForm.edit_name_a_cuid.value; //A\u7aef\u901a\u8fbe\u5730\u70b9\u7684CUID
  form.relatedZEndStationCuid = pBasicForm.edit_name_z_cuid.value; //Z\u7aef\u901a\u8fbe\u5730\u70b9\u7684CUID
  form.traphRate = pBasicForm.cmb_basic_traph_speed.value; //\u7535\u8def\u901f\u7387
  form.no = pBasicForm.edit_basic_traph_number.value; //\u7535\u8def\u7f16\u53f7
  //form.ext = pBasicForm.cmb_basic_traph_ext.value; //\u4e1a\u52a1\u7c7b\u578b
  form.extIds = pBasicForm.edit_basic_traph_ext_id.value;//\u591a\u4e2a\u4e1a\u52a1\u7c7b\u578b\u7684id
  form.importLevel = pBasicForm.importLevel.value;
  //alert("s2");
  form.traphLevel = pBasicForm.cmb_basic_traph_level.value; //\u7535\u8def\u7ea7\u522b
  form.ownership = pBasicForm.cmb_basic_traph_owner.value; //\u7535\u8def\u4ea7\u6743
  form.traphType = pBasicForm.cmb_basic_traph_type.value; //\u7535\u8def\u7c7b\u578b
  form.alias = pBasicForm.edit_basic_traph_alias.value; //\u7535\u8def\u522b\u540d
  form.endDfPortA = pBasicForm.edit_end_df_portA.value; //A\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
  form.endDfPortZ = pBasicForm.edit_end_df_portZ.value; //Z\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
  //alert("s3");
  form.extpath1A = pBasicForm.area_extpath1A.value; //A\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
  form.extpath1Z = pBasicForm.area_extpath1Z.value; //Z\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531
  form.jhroomA = pBasicForm.edit_jhroomA.value; //A\u7aef\u4e1a\u52a1\u673a\u623f
  form.jhroomZ = pBasicForm.edit_jhroomZ.value; //Z\u7aef\u4e1a\u52a1\u673a\u623f
  /*
  if(pBasicForm.cmb_basic_traph_type.value!=3){
    form.notes = pBasicForm.edit_basic_traph_memo.value; //\u7535\u8def\u5907\u6ce8
  }else {
        form.notes = pBasicForm.edit_basic_traph_memoMstp.value; //\u7535\u8def\u5907\u6ce8 Mstp
  }
  */
  form.notes = pBasicForm.edit_basic_traph_memo.value; //\u7535\u8def\u5907\u6ce8
  form.pathinfo = pBasicForm.area_pathinfo.value; //\u8def\u7531\u63cf\u8ff0\u4fe1\u606f
	form.pathinfoRemark=pBasicForm.area_pathinfo_remark.value;//pathinfoRemark add by liuzhongxiang 2009--1-15

  //alert("s4");
  form.relatedAEndSwitchdevCuid = pBasicForm.edit_endSwitchDevA_cuid.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
  form.relatedZEndSwitchdevCuid = pBasicForm.edit_endSwitchDevZ_cuid.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u6807\u8bc6
  form.endSwitchDevA = pBasicForm.edit_endSwitchDevA.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
  form.endSwitchDevZ = pBasicForm.edit_endSwitchDevZ.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0
  form.relatedAEndSwitchPortCuid = pBasicForm.edit_endSwitchdevPortACuid.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
  form.relatedZEndSwitchPortCuid = pBasicForm.edit_endSwitchdevPortZCuid.value;//Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
  //alert("s5");
  form.endSwitchdevPortA = pBasicForm.edit_endSwitchdevPortA.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
  form.endSwitchdevPortZ = pBasicForm.edit_endSwitchdevPortZ.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
  form.transPortACuid =  pBasicForm.edit_transPortACuid.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3CUID
  form.transPortZCuid =  pBasicForm.edit_transPortZCuid.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3CUID
  form.transPortAName =  pBasicForm.edit_transPortAName.value; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3
  form.transPortZName =  pBasicForm.edit_transPortZName.value; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u5bf9\u5e94\u4f20\u8f93\u8bbe\u5907\u7aef\u53e3
  form.relatedAZdSiteCuid = pBasicForm.edit_a_zdsite_cuid.value; //A\u7aef\u7ec8\u7aef\u7ad9\u70b9
  form.relatedZZdSiteCuid = pBasicForm.edit_z_zdsite_cuid.value; //Z\u7aef\u7ec8\u7aef\u7ad9\u70b9
  //added by liuyingnan 070328 MSTP \u7535\u8def\u8c03\u5ea6 \u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u5c5e\u6027 begin
  form.endPortA  = pBasicForm.edit_macPortA.value ;//A\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
  form.relatedAMacPortCuid  =  pBasicForm.edit_macPortACuid.value;//A\u7aef\u4f20\u8f93\u7aef\u53e3cuid \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
  form.endPortZ = pBasicForm.edit_macPortZ.value;//Z\u7aef\u4f20\u8f93\u7aef\u53e3name  \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
  form.relatedZMacPortCuid =   pBasicForm.edit_macPortZCuid.value;//A\u7aef\u4f20\u8f93\u7aef\u53e3cuid \u7528\u4e8e\u4fdd\u5b58Mstp MAC \u7aef\u53e3\u4fe1\u606f
  form.endVctrunkA  =  pBasicForm.edit_vctrunkPortA.value;//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
  form.relatedAVctrunkCuid   =   pBasicForm.edit_vctrunkPortA_cuid.value;//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3CUID
  form.endVctrunkZ   =   pBasicForm.edit_vctrunkPortZ.value;//A\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3\u4fe1\u606f
  form.relatedZVctrunkCuid = pBasicForm.edit_vctrunkPortZ_cuid.value;//Z\u7aef\u5bf9\u5e94\u7684VCTRUNK\u7aef\u53e3CUID
  form.endVlanidA =   pBasicForm.edit_vlanidA.value;//A\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
  form.endVlanidZ  =   pBasicForm.edit_vlanidZ.value ;//Z\u7aef\u5bf9\u5e94\u7684VLANID\u4fe1\u606f
  //added by liuyingnan 070328 MSTP \u7535\u8def\u8c03\u5ea6 \u4ee5\u592a\u7f51\u4e1a\u52a1\u914d\u7f6e\u5c5e\u6027 end
  if (pBasicForm.cmb_basic_traph_sp.value!=""&&pBasicForm.cmb_basic_traph_sp.value!=null) {  //\u51fa\u79df\u7528\u6237\u521d\u59cb\u5316\u65e0\u6570\u636e\u65f6\u4e0d\u51fa\u9519 \u6b64\u5904\u4e3atext\uff0c\u4e00\u5b9a\u8981\u6ce8\u610f
    form.userName = pBasicForm.cmb_basic_traph_sp.value; //\u51fa\u79df\u7528\u6237
    form.userCuid = pBasicForm.cmb_basic_traph_sp_cuid.value;
  } else {
    form.userName = "";
    form.userCuid = "";
  }
  //alert("s6");
  //if(pBasicForm.cmb_basic_traph_type.value!=3){
    form.requestDate = pBasicForm.edit_basic_plan_datetime.value; //\u8981\u6c42\u65f6\u95f4
    form.usedDate = pBasicForm.edit_basic_real_datetime.value;//\u5f00\u901a\u65f6\u95f4
// }else {
//    form.requestDate = pBasicForm.edit_basic_plan_datetimeMstp.value; //\u8981\u6c42\u65f6\u95f4
//    form.usedDate = pBasicForm.edit_basic_real_datetimeMstp.value;//\u5f00\u901a\u65f6\u95f4Mstp
//  }
  if(pBasicForm.cmb_basic_traph_type.value==3){
    form.bandWidth = pBasicForm.edit_basic_bandwidthMstp.value;//Mstp
  }
  form.sdxc1A = pBasicForm.edit_sdxc1A.value; //A\u7aefSDXC1
  form.sdxc1Z = pBasicForm.edit_sdxc1Z.value; //Z\u7aefSDXC1
  form.sdxc2A = pBasicForm.edit_sdxc2A.value; //A\u7aefSDXC2
  form.sdxc2Z = pBasicForm.edit_sdxc2Z.value; //Z\u7aefSDXC2
  if(pBasicForm.edit_zjdfA.value == null){
    pBasicForm.edit_zjdfA.value='';
  }
  form.zjdfA = pBasicForm.edit_zjdfA.value; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
  if(pBasicForm.edit_zjdfZ.value == null){
    pBasicForm.edit_zjdfZ.value='';
  }
  form.zjdfZ = pBasicForm.edit_zjdfZ.value; //Z\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
  form.zjsiteCuids = pBasicForm.edit_zjsites_cuid.value; //\u8f6c\u63a5\u7ad9cuid\u9017\u53f7\u4e32
  //alert("s7");
  form.endSwitchDfPortA = pBasicForm.edit_endSwitchDfPortA.value; //A\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
  form.endSwitchDfPortZ = pBasicForm.edit_endSwitchDfPortZ.value; //Z\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
  form.useType = pBasicForm.cmb_basic_traph_use.value //\u7535\u8def\u7528\u9014
  //--------\u5176\u4ed6\u4fe1\u606f
  //alert("s8");
//  alert(pOtherForm.cmb_protectModes);
//  alert(pOtherForm.cmb_protectModes.value);
  form.protectMode = pOtherForm.cmb_protectModes.value; //\u4fdd\u62a4\u65b9\u5f0f
  form.serviceQuality = pOtherForm.edit_serviceQuality.value; //\u670d\u52a1\u8d28\u91cf
  form.dispathName = pOtherForm.dispath_nameValue.value; //\u6587\u53f7
  form.zjdfPorts = pOtherForm.edit_zjdfPorts.value; //\u8f6c\u63a5\u914d\u7ebf\u67b6
  form.textRemarkInfo = pOtherForm.area_remarkinfo.value;//\u5176\u5b83\u4fe1\u606f\u7535\u8def\u5907\u6ce8 add by jej on 20060108
  //alert("s9");
    form.isProrityMonitorsTraph = pOtherForm.chk_isPriorityTraph.checked;
    form.stopTime = pOtherForm.stop_time.value;
    form.longDistanceTraphName =  pOtherForm.edit_distance_name.value;
    form.businessDiscussedTraphName = pOtherForm.edit_business_name.value;
    form.cutomerTraphname = pOtherForm.edit_customer_name.value;
    //\u662f\u5426\u6d4b\u8bd5\u7535\u8def
    form.isTestTraph = pOtherForm.chk_isTestTraph.checked;
    form.zjsites	= pBasicForm.edit_zjsites_name.value; //\u8f6c\u63a5\u7ad9\u540d
    form.zjsitesInternational = pBasicForm.edit_zjsites_name_international.value;
    if(form.traphLevel=='1'){
        //add by liuzhongxiang 2009-1-20//\u56fd\u9645\u7535\u8def\u7279\u6709\u5c5e\u6027
        //\u57fa\u672c\u9875\u9762
        form.sign=pBasicForm.sign.value;
        form.zjsitesInternational=pBasicForm.edit_zjsites_name_international.value;
        form.dcme=pBasicForm.DCME.value;
        form.leaseType=pBasicForm.LEASE_TYPE.value;
        //\u79df\u7528\u6bb5\u9875\u9762
        //form.endOperator =
        //\u5176\u5b83\u9875\u9762
        form.cable = pOtherForm.edit_cabel_name.value;
        form.rentYuan = pOtherForm.edit_yuan_name.value;
        form.rentUSD = pOtherForm.edit_usd_name.value;
        form.term = pOtherForm.cmb_othre_traph_term.value;
        //end
        }
    }

function updateTraphInfoNew(){//add by jej on 20070901\u6279\u91cf\u4fee\u6539\u5c5e\u6027
    var traphEditForm = new Object;
    //portA.setFocused(true);
    //alert(DevA);
    //alert(DevZ);
    if(aport.checked){
      traphEditForm.endSwitchDevA = endSwitchDevA.value;
      traphEditForm.relatedAEndSwitchdevCuid = relatedDevACuid;
      traphEditForm.jhroomA = JHRoomACuid;
      if(DevA!="true1"){
        DevA = "true";
      }
    }

    if(zport.checked){
    //alert('2');
      traphEditForm.endSwitchDevZ = endSwitchDevZ.value;
      traphEditForm.relatedZEndSwitchdevCuid = relatedDevZCuid;
      traphEditForm.jhroomZ = JHRoomZCuid;
      if(DevZ!="true1"){
        DevZ = "true";
      }
    }

    if(level.checked) {
    //alert('3');
      if(traphLevel.value>0) {
        traphEditForm.traphLevel = traphLevel.value;
      } else {
          alert('\u7ea7\u522b\u4e0d\u80fd\u4e3a\u7a7a\uff01');
          return;
      }
      levelflag = true;
    }
    //alert('4');
    if(setType.checked){
      traphEditForm.extIds = edit_basic_traph_ext_id.value;
      typeflag = true;
    }

    if(resetTime.checked){
    //alert('5');
      if(realTime.value!=null&&realTime.value!="") {
        traphEditForm.requestDateString = realTime.value;
      }else {
         alert('\u5f00\u901a\u65f6\u95f4\u4e0d\u80fd\u4e3a\u7a7a');
         return;
        }
      timeflag = true;
    }

    if (resetRequestTime.checked) {
      //alert('6');
      if(requestTime.value!=null&&requestTime.value!="") {
        traphEditForm.requestDate = requestTime.value;
      }else {
        alert('\u8981\u6c42\u65f6\u95f4\u4e0d\u80fd\u4e3a\u7a7a');
        return;
      }
      requesttimeflag = true;
    }

    if (resetOwnerShip.checked) {
      //alert('7');
      if(ownership.value>0) {
        traphEditForm.ownership = ownership.value;
      } else {
        alert('\u4ea7\u6743\u4e0d\u80fd\u4e3a\u7a7a\uff01');
        return;
      }
      ownershipflag = true;
    }

    if (isUse.checked) {
      //alert('8');
      if(use.value>0) {
        traphEditForm.useType = use.value;
      } else {
        alert('\u7528\u9014\u4e0d\u80fd\u4e3a\u7a7a\uff01');
        return;
      }
      usetypeflag = true;
    }

    if(isRemark.checked){
      //alert('9');
      traphEditForm.remark = remark.value;
      remarkflag = true;
    }

    if (isUser.checked) {
      //alert('10');
      traphEditForm.userName = cmb_basic_traph_sp.value; //\u51fa\u79df\u7528\u6237
      traphEditForm.userCuid = cmb_basic_traph_sp_cuid.value;
      userflag = true;
    }

    TraphAjaxActionNew.saveModifysTraphInfo(traphEditForm,DevA,DevZ,devportA,devportZ,objectId,levelflag,typeflag,timeflag,aport.checked,zport.checked,requesttimeflag,ownershipflag,usetypeflag,remarkflag,userflag,function(e){
      window.dialogArguments.location = "/webmaster/traph/uTraphMain.jsp?refreshType=addTraph";
      window.close();
    })
    return true;
}

//\u6279\u91cf\u4fee\u6539\u7535\u8def\u5c5e\u6027 wangyisong 061123
function updateTraphInfo(){
    var traphEditForm = new Object;
    portA.setFocused(true);
    //alert(DevA);
    //alert(DevZ);
    if(acheckbox==true){
      traphEditForm.endSwitchDevA = edit_endSwitchDevA.getValue();
      traphEditForm.relatedAEndSwitchdevCuid = edit_endSwitchDevA_cuid;
      traphEditForm.jhroomA = edit_jhroomA;
    }

    if(zcheckbox==true){
    //alert('2');
      traphEditForm.endSwitchDevZ = edit_endSwitchDevZ.getValue();
      traphEditForm.relatedZEndSwitchdevCuid = edit_endSwitchDevZ_cuid;
      traphEditForm.jhroomZ = edit_jhroomZ;
    }

    if(levelflag == true) {
    //alert('3');
      if(cmb_basic_traph_level.getValue()!=null&&cmb_basic_traph_level.getValue!="") {
        traphEditForm.traphLevel = cmb_basic_traph_level.getSelected().getValue();
      } else {
          alert('\u7ea7\u522b\u4e0d\u80fd\u4e3a\u7a7a\uff01');
          return;
        }
    }
    //alert('4');
    if(typeflag == true){
      traphEditForm.ext = cmb_basic_traph_type.getSelected().getValue();
    }
    if(timeflag == true){
    //alert('5');
      if(edit_basic_real_datetime.getValue()!=null&&edit_basic_real_datetime.getValue()!="") {
        traphEditForm.requestDateString = edit_basic_real_datetime.getValue();
      }else {
         alert('\u5f00\u901a\u65f6\u95f4\u4e0d\u80fd\u4e3a\u7a7a');
         return;
        }
    }

    if (requesttimeflag == true) {
      //alert('6');
      if(edit_basic_request_datetime.getValue()!=null&&edit_basic_request_datetime.getValue()!="") {
        traphEditForm.requestDate = edit_basic_request_datetime.getValue();
      }else {
        alert('\u8981\u6c42\u65f6\u95f4\u4e0d\u80fd\u4e3a\u7a7a');
        return;
      }
    }

    if (ownershipflag == true) {
      //alert('7');
      if(cmb_basic_ownership.getValue()!=null&&cmb_basic_ownership.getValue!="") {
        traphEditForm.ownership = cmb_basic_ownership.getSelected().getValue();
      } else {
        alert('\u4ea7\u6743\u4e0d\u80fd\u4e3a\u7a7a\uff01');
        return;
      }
    }

    if (usetypeflag == true) {
      //alert('8');
      if(cmb_basic_usetype.getValue()!=null&&cmb_basic_usetype.getValue!="") {
        traphEditForm.useType = cmb_basic_usetype.getSelected().getValue();
      } else {
        alert('\u7528\u9014\u4e0d\u80fd\u4e3a\u7a7a\uff01');
        return;
      }
    }

    if(remarkflag == true){
      //alert('9');
      traphEditForm.remark = edit_basic_remark.getValue();
    }

    if (userflag == true) {
      //alert('10');
      traphEditForm.userName = cmb_basic_user.getValue();
      if (cmb_basic_user.getSelected() != null) {
        traphEditForm.userCuid = cmb_basic_user.getSelected().getValue();
      }
    }

    TraphAjaxActionNew.saveModifysTraphInfo(traphEditForm,DevA,DevZ,flagA,flagZ,objectId,levelflag,typeflag,timeflag,acheckbox,zcheckbox,requesttimeflag,ownershipflag,usetypeflag,remarkflag,userflag,function(e){
      window.dialogArguments.location = "/webmaster/traph/uTraphMain.jsp?refreshType=addTraph";
      window.close();
    })
    return true;
}

/*------------------------------------------------------------------------------
\u4e0b\u8fb9\u662f\u516c\u5171\u65b9\u6cd5\u548c\u5c5e\u6027 wangyisong 061109
------------------------------------------------------------------------------*/
//\u9009\u62e9\u79df\u7528\u548c\u81ea\u5efa\u7684\u9ed8\u8ba4\u901a\u8fbe\u5730\u70b9\uff08\u7ad9\u70b9/\u673a\u623f/\u7f51\u5143\uff09liuyingnan 20061120
     function selDefaultEndPoint(name,cuid){//todo \u9700\u8981\u653e\u5230\u516c\u5171\u7684js\u4e2d
     var lv = selectArea(false,true);
     if(lv!=null && typeof(lv)!="undefined"){
       if(lv.indexOf("@")>0){
         name.value = lv.split("@")[1];
         cuid.value = lv.split("@")[0];
       }
     }
   }

     //\u79df\u7528\u548c\u81ea\u5efa\u6bb5\u81ea\u52a8\u751f\u6210\u7535\u8def\u540d\u79f0 liuyingnan 20061120
     function generateName(orig,dest,no,name){//todo \u9700\u8981\u653e\u5230\u516c\u5171\u7684js\u4e2d
     if(orig.value!='' && dest.value!='' && no.value!=''){
       name.value = orig.value+'-'+dest.value+fillNo(no.value);
     }else{
       alert("\u8bf7\u9009\u62e9\u901a\u8fbe\u5730\u70b9\u548c\u7535\u8def\u7f16\u53f7\uff01");
     }
   }
   //\u79df\u7528\u548c\u81ea\u5efa\u6bb5 \u9a8c\u8bc1\u7535\u8def\u7f16\u53f7\u662f\u5426\u8f93\u5165\u6570\u5b57  liuyingnan 20061120
   function checkNo(src){//todo \u9700\u8981\u653e\u5230\u516c\u5171\u7684js\u4e2d
   var no =src.value;
   if(no!=''){
     var tmp ='';
     if(!integerValidator(no,false)){
       src.focus();
       alert('\u8bf7\u8f93\u5165\u6570\u5b57');
     }else{
       src.value=fillNo(no);
     }
   }
 }
 //\u79df\u7528\u548c\u81ea\u5efa\u6bb5 \u7ed9\u7535\u8def\u7f16\u53f7\u88650 liuyingnan 20061120
 function fillNo(no){//todo \u9700\u8981\u653e\u5230\u516c\u5171\u7684js\u4e2d
 var rtn = '';
 if(no.length<4){
   for(i=0;i<4-no.length;i++){
     rtn+='0';
   }
 }
 rtn+= no;
 return rtn;
}
/*
\u5f39\u51fa\u7ad9\u70b9/\u673a\u623f/\u7f51\u5143\u9009\u62e9\u7a97\u4f53
obj0:CUID; obj1:\u4e2d\u6587\u6807\u8bc6; obj2:\u7c7b\u578b\uff1a\u533a\u57df(1000)\uff0c\u7ad9\u70b9(1001)\uff0c\u673a\u623f(1003)\uff0c\u4f20\u8f93\u7f51\u5143(4008),\u4e1a\u52a1\u7f51\u5143(4006)
*/
function selectSite(obj0,obj1,obj2){
      var features = "dialogWidth:"+500+"px;dialogHeight:"+500+"px; scroll:0; help:0; status:yes; fullscreen;";
      features +=	"dialogLeft:300;dialogTop:300";
      var lv =  window.showModalDialog("/webmaster/common/jsp/areaSelect.jsp?district=true&site=true","",features);
      if(lv!=null){
        if(lv.indexOf("@")>0){
          obj0.value=lv.split("@")[0];
          //alert(obj0.value);
          //alert("cuid="+obj0.value);
          if (obj1!=''){
            obj1.value=lv.split("@")[1];
          }
          if (obj2!=''){
      	    //obj2.value=lv.split("@")[2];//\u6682\u65f6\u5c4f\u853d
      	   obj2='SITE';
         }
       }
    }
}

        /*
        *\u8c03\u5ea6\u4e2d\u521d\u59cb\u5316\u4fe1\u606f
        *\u53c2\u6570objId \u8c03\u5355ID
        *\u53c2\u6570attempType\u8c03\u5355\u7c7b\u578b
        *zhangzhanming 20061114
        */
            //--------\u5f97\u5230\u4fee\u6539\u7535\u8def\u4fe1\u606f----------------------------------------------------------------------------
        function getModifyAttempInfo(objId,attempType){
            if(attempType == '3'){//\u8c03\u6574 \u8c03\u524d
                TraphAjaxActionNew.getModifyAttempInfo(objId,'pre',function(data){
                    if (data != null) {
                        if(typeof(parent.basicPagePre)!='undefined'){
                            copyTraphInfo(data,parent.basicPagePre.document.pBasicForm,parent.otherPagePre.document.pOtherForm);//\u8c03\u524d
                            copyAttempInfo(data,parent.parent.tabbar.tabWindow("attemp").attempForm);
                        }
                    }
                });
            }
            if(attempType == '1' || attempType == '3'){//\u65b0\u589e \u8c03\u540e
                TraphAjaxActionNew.getModifyAttempInfo(objId,'suf',function(data){
                    if (data != null) {
                        if(typeof(parent.basicPage)!='undefined'){
                            copyTraphInfo(data,parent.basicPage.document.pBasicForm,parent.otherPage.document.pOtherForm);//\u65b0\u589e\uff0c\u8c03\u540e
                            copyAttempInfo(data,parent.parent.tabbar.tabWindow("attemp").attempForm);
                        }
                    }
                });
            }else if(attempType == '2'){//\u505c\u95ed
                TraphAjaxActionNew.getModifyAttempInfo(objId,'pre',function(data){
                    if (data != null) {
                        copyTraphInfo(data,parent.basicPage.document.pBasicForm,parent.otherPage.document.pOtherForm);
                        copyAttempInfo(data,parent.parent.tabbar.tabWindow("attemp").attempForm);
                    }
                });
            }
        }


        /*
        *\u9009\u62e9\u5f00\u901a\u65f6\u95f4\u548c\u8981\u6c42\u65f6\u95f4\u5171\u7528\u51fd\u6570
        *\u53c2\u6570src \u662f\u5f00\u901a\u65f6\u95f4\uff0c\u8981\u6c42\u65f6\u95f4\u5bf9\u5e94\u7684\u663e\u793a\u65f6\u95f4\u7684\u6587\u672c\u6846\u7684name
        *zhangzhanming 20061109
        */
            function funSelectTime(src){
                var tmpdate = showWindow('/common/jsp/calendar.jsp?id=tmpText',150,280,2);
                if (tmpdate != null && tmpdate != 'undefined'){
                src.value = tmpdate;
                }else {
                src.value = '';
                }

            }
        /*
        *\u9009\u62e9\u7535\u8def\u7f16\u53f7
        *\u53c2\u6570src \u7f16\u53f7\u5bf9\u5e94\u7684\u6587\u672c\u6846\uff1b\u901a\u8fbe\u5730\u70b9A\u7aefCuid aCuid,\u901a\u8fbe\u5730\u70b9\u7aefCuidzCuid,traphRate
        *zhangzhanming 20061109
        */
        function setTraphNumber(src,aCuid,zCuid,traphRate){
            if(aCuid.value!='' && zCuid.value!=''){
                var height = window.screen.height/6;
                var width = window.screen.width/4;
                var features = "dialogWidth:"+700+"px;dialogHeight:"+560+"px; scroll:0; help:0; status:no; fullscreen;";
                features +=	"dialogLeft:180;dialogTop:100";
                url = "/webmaster/traph/noSegSelect.do?relatedAEndStationCuid="+aCuid.value
                +"&relatedZEndStationCuid="+zCuid.value
                +"&traphRate="+ traphRate.value
                +"&traphNameRule=1"
                +"&timestamp="+(new Date()).getTime();
                var tmpobj = new Object();
                var traphnoObject = document.getElementById("edit_basic_traph_number");
                tmpobj.traphno = traphnoObject.value;
                rv=window.showModalDialog(url,tmpobj,features);
                if(rv!=null){
                   src.value = rv;
                }
          } else {
            alert("\u8bf7\u5148\u9009\u62e9\u540d\u79f0\u4fe1\u606f\uff01");
           }
        }

        //\u521d\u59cb\u5316\u679a\u4e3e\u503c
        function addDataToList(list,data){
          if(data.length>0){
            for(i=0;i<data.length;i++){
              addOptionToList(list, data[i].label, data[i].value);
            }
          }
        }

function selectSiteWithParent(obj0,obj1,obj2,obj3){//obj3 room
   selectSite(obj0,obj1,obj2);
   if (obj3!=''){
   obj3.value="BJSwichRoom1"
   obj3.disabled="true";
  }
}
/*
\u5f39\u51fa\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u9009\u62e9\u7a97\u4f53
obj0:\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3CUID; obj1:\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u4e2d\u6587\u6807\u8bc6; str0:\u7535\u8def\u901f\u7387\uff1b
str1:\u9009\u62e9\u7aef\u53e3\u4e2a\u6570;str2:\u4e1a\u52a1\u8bbe\u5907CUID\uff1bstr3:\u4e1a\u52a1\u8bbe\u5907\u4e2d\u6587\u6807\u8bc6\uff1b
*/
function selectSwitchPort(obj0,obj1,str0,str1,str2,str3){
  var features = "dialogWidth:"+500+"px;dialogHeight:"+500+"px; scroll:0; help:0; status:yes; fullscreen;";
  features +=	"dialogLeft:300;dialogTop:300";
  str1=1;
  url = "<%=request.getContextPath()%>/traph/switchPortList.do?timestamp="+(new Date()).getTime()+"&traphRate="+str0+"&dlCount="+str1
                                                           +"&switchDevCuid="+str2+"&switchDevName="+str3;

  lv=window.showModalDialog(url,traphBasicForm,features);
  if(lv!=null && typeof(lv)!="undefined"){
    if(lv.indexOf("@")>0){
      obj0.value=lv.split("@")[0];
      if (obj1!=''){
        obj1.value=lv.split("@")[1];
      }
    }
  }
}

function initTraphList(tmpgrid){
    tmpgrid.selMultiRows = true;
    tmpgrid.setImagePath("/webmaster/common/resource/image/property/");
    tmpgrid.setHeader("\u7535\u8def\u540d\u79f0,\u4ea7\u6743,A\u7aef\u8bbe\u5907,A\u7aef\u8bbe\u5907\u7aef\u53e3,A\u7aef\u914d\u7ebf\u67b6,Z\u7aef\u8bbe\u5907,Z\u7aef\u8bbe\u5907\u7aef\u53e3,Z\u7aef\u914d\u7ebf\u67b6");
    tmpgrid.setHeaderIds("LABEL_CN,OWNERSHIP,END_SWITCH_DEV_A,END_SWITCHDEV_PORT_A,END_SWITCH_DF_PORT_A,END_SWITCH_DEV_Z,END_SWITCHDEV_PORT_Z,END_SWITCH_DF_PORT_Z");
    tmpgrid.setInitWidthsP("21,9,12,12,11,11,12,11");
    tmpgrid.setColAlign("left,center,center,center,center,center,center,center");
    tmpgrid.setColTypes("ro,coro,ro,ro,ro,ro,ro,ro");
    tmpgrid.setColSorting("str,str,str,str,str,str,str,str");
    tmpgrid.setColumnColor("#ffffff,#ffffff,#ffffff,#ffffff,#ffffff,#ffffff,#ffffff,#ffffff");
    tmpgrid.setOnRowSelectHandler(openSelectRow);
    tmpgrid.setOnGridDataQuery(queryTraphList);
}

function initDlProperty(tmpgrid){
    tmpgrid.selMultiRows = true;
    tmpgrid.setImagePath("/webmaster/common/resource/image/property/");
    tmpgrid.setHeader("\u5c5e\u6027,\u503c");
    tmpgrid.setInitWidthsP("35,70");
    tmpgrid.setColAlign("left,left");
    tmpgrid.setColumnColor("#D4D4D4,#ffffff");
    initProList(tmpgrid);
    tmpgrid.init();
    var i=0;
    tmpgrid.addRow("labelCn","labelCn.\u7535\u8def\u540d\u79f0,",i++,"ed","");
    tmpgrid.addRow("endStationA","endStationA.A\u7aef\u901a\u8fbe\u5730\u70b9,",i++,"ed","");
    tmpgrid.addRow("endStationZ","endStationZ.Z\u7aef\u901a\u8fbe\u5730\u70b9,",i++,"ed","");
    tmpgrid.addRow("traphRate","traphRate.\u7535\u8def\u901f\u7387,",i++,"colist","");
    tmpgrid.addRow("no","no.\u7535\u8def\u7f16\u53f7,",i++,"ed","");
    tmpgrid.addRow("ext","ext.\u4e1a\u52a1\u7c7b\u578b,",i++,"colist","");
    tmpgrid.addRow("notes","notes.\u7535\u8def\u5907\u6ce8,",i++,"ed","");
    tmpgrid.addRow("pathinfo","pathinfo.\u8def\u7531,",i++,"ed","");
    tmpgrid.addRow("ownership","ownership.\u4ea7\u6743,",i++,"colist","");
    tmpgrid.addRow("alias","alias.\u522b\u540d,",i++,"ed","");
    tmpgrid.addRow("traphLevel","traphLevel.\u7ea7\u522b,",i++,"colist","");
    tmpgrid.addRow("useType","useType.\u7535\u8def\u7528\u9014,",i++,"colist","");
    tmpgrid.addRow("importLevel","importLevel.\u91cd\u8981\u6027\u7ea7\u522b,",i++,"colist","");
    tmpgrid.addRow("requestDate","requestDate.\u8981\u6c42\u65f6\u95f4,",i++,"ed","");
    tmpgrid.addRow("usedDate","usedDate.\u5f00\u901a\u65f6\u95f4,",i++,"ed","");
    tmpgrid.addRow("relatedAZdSiteName","relatedAZdSiteName.A\u7aef\u7ec8\u7aef\u7ad9\u70b9,",i++,"ed","");
    tmpgrid.addRow("relatedZZdSiteName","relatedZZdSiteName.Z\u7aef\u7ec8\u7aef\u7ad9\u70b9,",i++,"ed","");
    tmpgrid.addRow("jhroomA","jhroomA.A\u7aef\u4e1a\u52a1\u673a\u623f,",i++,"ed","");
    tmpgrid.addRow("jhroomZ","jhroomZ.Z\u7aef\u4e1a\u52a1\u673a\u623f,",i++,"ed","");
    tmpgrid.addRow("endSwitchDevA","endSwitchDevA.A\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0,",i++,"ed","");
    tmpgrid.addRow("endSwitchDevZ","endSwitchDevZ.Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u540d\u79f0,",i++,"ed","");
    tmpgrid.addRow("endSwitchdevPortA","endSwitchdevPortA.A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3,",i++,"ed","");
    tmpgrid.addRow("endSwitchdevPortZ","endSwitchdevPortZ.Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3,",i++,"ed","");
    tmpgrid.addRow("endDfPortA","endDfPortA.A\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("endDfPortZ","endDfPortZ.Z\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("zjdfA","zjdfA.A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("zjdfZ","zjdfZ.Z\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("endSwitchDfPortA","endSwitchDfPortA.A\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("endSwitchDfPortZ","endSwitchDfPortZ.Z\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("sdxc1A","sdxc1A.A\u7aefSDXC1,",i++,"ed","");
    tmpgrid.addRow("sdxc1Z","sdxc1Z.Z\u7aefSDXC1,",i++,"ed","");
    tmpgrid.addRow("sdxc2A","sdxc2A.A\u7aefSDXC2,",i++,"ed","");
    tmpgrid.addRow("sdxc2Z","sdxc2Z.Z\u7aefSDXC2,",i++,"ed","");
    tmpgrid.addRow("extpath1A","extpath1A.A\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531,",i++,"ed","");
    tmpgrid.addRow("extpath1Z","extpath1Z.Z\u7aef\u5ef6\u4f38\u6bb5\u8def\u7531,",i++,"ed","");
    tmpgrid.addRow("zjdfPorts","zjdfPorts.\u8f6c\u63a5\u914d\u7ebf\u67b6,",i++,"ed","");
    tmpgrid.addRow("zjsites","zjsites.\u8f6c\u63a5\u7ad9\u540d,",i++,"ed","");
}

function copyAttempInfo(data,form){
    form.clbm.value = data.clbm;
    form.clbmCuids.value = data.clbmCuid;
    if(data.relatedApplyCuid!=null){
        form.appWhCuid.value = data.relatedApplyCuid;
    }
    if(data.relatedApplyWh!=null){
        form.appWhT.value = data.relatedApplyWh;
    }

//    zdCombox.removeAll();
    if (data.relatedMasterDepCuid != null){
        addOptionToList(form.masterDep,data.relatedMasterDepName,data.relatedMasterDepCuid);
    }
    if ((data.relatedMasterDgnDepCuid != null) && (data.relatedMasterDepCuid != data.relatedMasterDgnDepCuid)){
        addOptionToList(form.masterDep,data.relatedMasterDgnDepName,data.relatedMasterDgnDepCuid);
    }

    if(data.clbmCuid!='undefined'){
        var len =data.clbmCuid.split(",").length;
        for (var i=0;i<len;i++){
            if ((data.clbmCuid.split(",")[i] != data.relatedMasterDepCuid) && (data.clbmCuid.split(",")[i] != data.relatedMasterDgnDepCuid)){
               addOptionToList(form.masterDep,data.clbm.split(",")[i],data.clbmCuid.split(",")[i]);
            }
        }
    }
    if(data.writeResult != null) {
      form.state2.value = data.writeResult;
    }

    if(data.attempResult != null) {
        form.attResult.value = data.attempResult;
    }

    if(data.serviceComState != null) {
     form.state.value = data.serviceComState;
    }
}

    function selectArea(district,notswitch){
        var features = "dialogWidth:"+500+"px;dialogHeight:"+550+"px; scroll:0; help:0; status:yes; fullscreen;";
        features +=	"dialogLeft:300;dialogTop:300";
        if(district!=true){
          if(notswitch==true){
            var lv =  window.showModalDialog("/webmaster/traph/common/areaSelect.jsp?timestamp="+(new Date()).getTime()+"&notswitch=true","",features);
          }else{
            var lv =  window.showModalDialog("/webmaster/traph/common/areaSelect.jsp?timestamp="+(new Date()).getTime(),"",features);
          }
        }else{
          if(notswitch==true){
            var lv =  window.showModalDialog("/webmaster/traph/common/areaSelect.jsp?timestamp="+(new Date()).getTime()+"&district="+district+"&notswitch=true","",features);
          }else{
            var lv =  window.showModalDialog("/webmaster/traph/common/areaSelect.jsp?timestamp="+(new Date()).getTime()+"&district="+district,"",features);
          }
        }
        return lv;
    }

   function resetModelValue(basicObj,otherObj,src){
      basicObj.edit_traph_name.value = ""; //\u7535\u8def\u540d\u79f0
      basicObj.edit_basic_traph_number.value = ""; //\u7535\u8def\u7f16\u53f7
      basicObj.edit_endSwitchdevPortACuid.value = ""; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
      basicObj.edit_endSwitchdevPortZCuid.value = ""; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3\u6807\u8bc6
      basicObj.edit_endSwitchdevPortA.value = ""; //A\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
      basicObj.edit_endSwitchdevPortZ.value = ""; //Z\u7aef\u4e1a\u52a1\u8bbe\u5907\u7aef\u53e3
      basicObj.edit_sdxc1A.value = ""; //A\u7aefSDXC1
      basicObj.edit_sdxc1Z.value = ""; //Z\u7aefSDXC1
      basicObj.edit_sdxc2A.value = ""; //A\u7aefSDXC2
      basicObj.edit_sdxc2Z.value = ""; //Z\u7aefSDXC2
      basicObj.edit_zjdfA.value = ""; //A\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
      basicObj.edit_zjdfZ.value = ""; //Z\u7aef\u8f6c\u63a5\u914d\u7ebf\u67b6\u7aef\u5b50
      basicObj.edit_endSwitchDfPortA.value = ""; //A\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
      basicObj.edit_endSwitchDfPortZ.value = ""; //Z\u7aef\u4e1a\u52a1\u914d\u7ebf\u67b6\u7aef\u5b50
      basicObj.edit_end_df_portA.value = "";//A\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50
      basicObj.edit_end_df_portZ.value = "";//Z\u7aef\u4f20\u8f93\u914d\u7ebf\u67b6\u7aef\u5b50

      //--------\u5176\u4ed6\u4fe1\u606f
      otherObj.edit_zjdfPorts.value = ""; //\u8f6c\u63a5\u914d\u7ebf\u67b6
      basicObj.area_pathinfo.value = "";
      src.disabled='';

    }

function initSufTab(para){

  var tab = document.getElementById("addTab").value;
  if(tab == "" ) {
    return;
  }
  var rowA = document.createElement("tr");

  var basicIfr = document.createElement("iframe");
  basicIfr.setAttribute("id","basicPage");
  basicIfr.setAttribute("src","../../traph/uTraphBasic.jsp?"+para);
  basicIfr.setAttribute("width","780px");
  basicIfr.setAttribute("height","390px");

  var basicDiv = document.createElement("div");
  basicDiv.setAttribute("id","traphBasic");
  basicDiv.setAttribute("style","width:780px;height:420;border:1px");
  basicDiv.appendChild(basicIfr);

  var cellA = document.createElement("td");
  cellA.appendChild(basicDiv);
  rowA.appendChild(cellA);

  document.getElementById("basicPg").appendChild(rowA);

  var rowC = document.createElement("tr");

  var routeIfr = document.createElement("iframe");
  routeIfr.setAttribute("id","routePage");
  routeIfr.setAttribute("src","../../traph/uTraphRoute.jsp?"+para);
  routeIfr.setAttribute("width","780px");
  routeIfr.setAttribute("height","390px");

  var routeDiv = document.createElement("div");
  routeDiv.setAttribute("id","traphRoute");
  routeDiv.setAttribute("style","width:780px;height:420;border:1px");
  routeDiv.appendChild(routeIfr);

  var cellB = document.createElement("td");
  cellB.appendChild(routeDiv);
  rowC.appendChild(cellB);

  document.getElementById("routePg").appendChild(rowC);


  var rowB = document.createElement("tr");

  var otherIfr = document.createElement("iframe");
  otherIfr.setAttribute("id","otherPage");
  otherIfr.setAttribute("src","../../traph/uTraphOther.jsp?"+para);
  otherIfr.setAttribute("width","780px");
  otherIfr.setAttribute("height","390px");

  var otherDiv = document.createElement("div");
  otherDiv.setAttribute("id","traphOther");
  otherDiv.setAttribute("style","width:780px;height:420;border:1px");
  otherDiv.appendChild(otherIfr);

  var cellB = document.createElement("td");
  cellB.appendChild(otherDiv);
  rowB.appendChild(cellB);

  document.getElementById("otherPg").appendChild(rowB);
}

function initPreTab(para){
  var tab = document.getElementById("addTab").value;
  if(tab == "" ) {
    return;
  }
  var rowA = document.createElement("tr");
  var basicIfr = document.createElement("iframe");
  basicIfr.setAttribute("id","basicPage");
  basicIfr.setAttribute("src","../../traph/uTraphBasic.jsp?"+para);
  basicIfr.setAttribute("width","780px");
  basicIfr.setAttribute("height","390px");

  var basicDiv = document.createElement("div");
  basicDiv.setAttribute("id","traphBasic");
  basicDiv.setAttribute("style","width:780px;height:420;border:1px");
  basicDiv.appendChild(basicIfr);

  var cellA = document.createElement("td");
  cellA.appendChild(basicDiv);
  rowA.appendChild(cellA);

  document.getElementById("basicPg").appendChild(rowA);

  var rowB = document.createElement("tr");
  var otherIfr = document.createElement("iframe");
  otherIfr.setAttribute("id","otherPage");
  otherIfr.setAttribute("src","../../traph/uTraphOther.jsp?"+para);
  otherIfr.setAttribute("width","780px");
  otherIfr.setAttribute("height","390px");

  var otherDiv = document.createElement("div");
  otherDiv.setAttribute("id","traphOther");
  otherDiv.setAttribute("style","width:780px;height:420;border:1px");
  otherDiv.appendChild(otherIfr);

  var cellB = document.createElement("td");
  cellB.appendChild(otherDiv);
  rowB.appendChild(cellB);

  document.getElementById("otherPg").appendChild(rowB);
//  alert('ends');
}
 function setTestAreaValue(textObj,addValue){
   var desc = textObj.value;
   if(desc!=null && Trim(desc).length>0){
   var descStr = "";
   var descArr = desc.split('\r\n');//\u8fd9\u4e2a\u7b97\u6cd5\u662f\u4e3a\u4e86\u53bb\u9664\u591a\u4f59\u7684\u7a7a\u884c
   var descArrLen = descArr.length;
   for(var i = 0; i < descArrLen;i++){
   if(descArr[i]!=null && Trim(descArr[i]).length>0){
   descStr += "\r\n"+descArr[i];
   }
   }
   if(Trim(descArr[i]).length>0){
   descStr = descStr.substring(2,descStr.length);
   }
   textObj.value='';
   descStr = descStr +"\r\n"+addValue;
   textObj.value = descStr;
   }else{
     textObj.value=addValue;
  }
}

function isLevelin(channellevel,userlevel){
  var flag = false;
  if(channellevel==0){//\u7ea7\u522b\u4e3a\u672a\u77e5
    return true;
  }
  var arruserLevel = userlevel.split(",");
  var cnt = 0;
  for(var i=0;i<arruserLevel.length;i++){
      if(arruserLevel[i]==2||arruserLevel[i]==4||arruserLevel[i]==5||arruserLevel[i]==6){
        cnt++;
      }
      if(arruserLevel[i]==1&&channellevel==1){
        flag = true;
      }else if(arruserLevel[i]==2&&channellevel==2){
        flag = true;
      }else if(arruserLevel[i]==4&&channellevel==4){
        flag = true;
      }else if(arruserLevel[i]==5&&channellevel==5){
        flag = true;
      }else if(arruserLevel[i]==6&&channellevel==6){
        flag = true;
      }
      if(flag){
        break;
      }
  }
  if(!flag&&cnt>=4&&channellevel==3){//\u7701\u5185/\u672c\u5730
    flag = true;
  }
  return flag;
}

